SendMessage with muliple attachments

G

Guest

Using a module, I want to attach all of the files from a
specific folder into an Outlook e-mail. The code I'm using
for attachments is:

If Not IsMissing("c:\AS400\*.*") Then
Set objOutlookAttach = .Attachments.Add("c:\as400
\*.*")
End If

I can send (1) attachment but NOT ALL from the same
folder.

Is there a way to attach all of the files in a specific
folder to an e-mail?

thanks!
-brian
 
D

Dev Ashish

Is there a way to attach all of the files in a specific
folder to an e-mail?

You'll most likely need to set up a loop yourself to do this...

Dim name As String
name = Dir$("C:\LOGS\*.*")
Do While Len(name) > 0
Call .Attachments.Add(name)
' Get next file
name = Dir
Loop

-- Dev
 

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