Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attaching multiple files to an email

Status
Not open for further replies.

newfrontiers

Programmer
Oct 17, 2001
134
0
0
US
Can anyone direct me to a solution to add multiple files to an email. I need the user to be able to select the files in an Explore type environment.

Thanks for your help.

 
If you are using cdo it is something like this:
Code:
Dim objOutlook 
Dim ItmNewEmail 
Dim folderspec          As String
Dim filedate, fnamedate As String
Dim fdir As String
Dim OutputFileName          As String



filedate = Date

fnamedate = Format(filedate, "mmddyy")
OutputFileName = "somefilename"
fdir = "somedirectory\"

Set objOutlook = CreateObject("Outlook.Application")
Set ItmNewEmail = objOutlook.CreateItem(olMailItem)

    
With ItmNewEmail
     .To = "someadd@domain.com"
     .CC = "somemoreadds@domain.com"
     .Subject = "Your Subject Reports " & filedate
     .Body = "Attached please find today's reports." _
       & Chr(13) & Chr(13) & "Thank You."
     [b].Attachments.Add [/b](fdir & OutputFileName)
     [b].Attachments.Add [/b]fdir & "some other file" & fnamedate & ".xls"

     .Send                                                
'send files and notification
End With

If you are using SendObject, I think you may have to change to cdo.

Hope this helps,

Alex



It's a magical time of year in Philadelphia. Eagles training camp marks the end of another brutal season of complaining about the Phillies.
 
AlexCuse, thank you for the information. I will try to integrate. Right now I am using SendObject. Thanks again.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top