Add email to my PDF code

this is what i use to do exactly that at work:

Sub SendEmailFromOutlook(body As String, subject As String, toEmails As String, ccEmails As String, bccEmails As String)

Dim outApp As Object

Dim outMail As Object

Set outApp = CreateObject("Outlook.Application")

Set outMail = outApp.CreateItem(0)

With outMail

.to = toEmails

.CC = ccEmails

.BCC = bccEmails

.subject = subject

.HTMLBody = body

.Send 'Send the email

End With

Set outMail = Nothing

Set outApp = Nothing

End Sub

needs to have reference to the Outlook object library in references, and i believe the method in the with statement to attach a document is just ".attachments" and then you just set that equal to the file path of the documents

im sure with a few variables and loops you could do this for a whole distribution list no problem

/r/excel Thread