Auto emailing of files

S

Slyda

I have a batch of files for different customer, always called by the customer
name, but the contents of each file changes, and they are always saved in the
same folder.

I would like to email these files to my customers, automatically.

In another spreadsheet, I have the file (company) name in column A, and the
email address (es) in column B and / or C etc.

I would like some kind of macro, to look in column A for the company name,
which will be the file name, and go to the file always saved in the same
directory, attached it to an email, and email it to the address (es) in
column B, C etc.

This is to prevent having tio email all the files manually.

Using Excel 2003 and Outlook 2003.

Any help / guidance is aprpeciated.

Thank you
Richard
 
R

Ron de Bruin

Start with this example
http://www.rondebruin.nl/mail/folder2/files.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




Slyda said:
I have a batch of files for different customer, always called by the customer
name, but the contents of each file changes, and they are always saved in the
same folder.

I would like to email these files to my customers, automatically.

In another spreadsheet, I have the file (company) name in column A, and the
email address (es) in column B and / or C etc.

I would like some kind of macro, to look in column A for the company name,
which will be the file name, and go to the file always saved in the same
directory, attached it to an email, and email it to the address (es) in
column B, C etc.

This is to prevent having tio email all the files manually.

Using Excel 2003 and Outlook 2003.

Any help / guidance is aprpeciated.

Thank you
Richard


__________ Information from ESET Smart Security, version of virus signature database 3943 (20090317) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 3943 (20090317) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
M

MacGuy

Using Ron's code (which probably has saved thousands of manhours,thx Ron )
have the email saved in the drafts folder:
....
.Display 'either .Send or .Display
.Save
.Close olPromtForSave 'saves in Drafts folder
....

Then have the following in the Outlook projects module which will send all
the addressed mail in the Draft folder without having to open and send each
one, provided your drafts folder is one level below the parent folder:

Public Sub SendDrafts()

Dim draftItem As Long
Dim myOutlook As Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myFolders As Outlook.Folders
Dim myDraftsFolder As Outlook.MAPIFolder

'''''''send all items in the Drafts folder that are addressed
Set myOutlook = Outlook.Application
Set myNameSpace = myOutlook.GetNamespace("MAPI")
Set myFolders = myNameSpace.Folders

Set fdrInbox =
Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Parent
Set myDraftsFolder = myFolders(Format(fdrInbox, "@")).Folders("Drafts")
For draftItem = myDraftsFolder.Items.Count To 1 Step -1
If Len(Trim(myDraftsFolder.Items.Item(draftItem).To)) > 0 Then
myDraftsFolder.Items.Item(draftItem).Send
End If
Next draftItem

Set myDraftsFolder = Nothing
Set myNameSpace = Nothing
Set myOutlook = Nothing

MsgBox "Done", vbInformation, "Send Contents of Draft Folder"

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top