Madingo wrote:
I need to create a routine that will email all contents of a folder.
But The number of files and extensions will be different. Some will
have .doc and .xls. Is there a way to email the contents without having
to know the names of each file--or is there a may to interate through
the contents of the folder to get the names? Any help would be
appreciated. Thanks.
Bill Mahoney
The Alcott Group
bi***@alcottgroup.com
You could probably use CDO to handle the mailing routine stuff (search
the NG - I remember Lyle's nice example, so have a dig for that). Now
for the "entire contents of a directory" part.
1. if the path changes all the time, you could use the BrowseFolder API
at
www.mvps.org/access I think it's the first or second one in the
API section. It will return the full path to a directory.
2. then you can use DIR to loop through the contents and add to the
Attachments collection. There are examples of that here somewhere too.
(I'm sure, since I asked the question).
Once you've collected and attached all the contents of the directory,
you would just add a line of code to send the message and then go on to
the next record. If different people get the contents of different
folders, then it might get a little trickier, but not much.