send more then one attachment

  • Thread starter Thread starter shayperi
  • Start date Start date
S

shayperi

Guest
hi
i need to send more then one attachment in email from vba in acces
i did a loop on my items with add to attachments but he dont let me put more then one
please send me code sample
thnanks
 
Try this code:

Dim oul As Outlook.Application
Dim mli As Outlook.MailItem
Dim atts As Outlook.Attachments

Set oul = GetObject("", "Outlook.Application")
Set mli = oul.CreateItem(olMailItem)

mli.To = "Bla@Bla.com"
mli.Subject = "Access Report"

mli.Body = "Please find the attachement"

Set atts = mli.Attachments
atts.Add "C:\Eagle.gif", olByValue, 1, "Eagle"
atts.Add "C:\Budda.jpg", olByValue, 1, "Budda"
atts.Add "C:\Zulu.jpg", olByValue, 1, "Zulu"

mli.Display
 

Users who are viewing this thread

Back
Top Bottom