So I've been tryin to automate email sending. I have a pdf I want to be emailed to every person in a column every time an email is added. I am struggling with adding the pdf I want to send with .attachment.add then the "location"
Here is what i have written so far.
Sub SendEmail()
'
' SendEmail Macro
'
'
Dim OutlookApp As Outlook.Application
Dim OutlookMail As Outlook.MailItem
Set OutlookApp = New Outlook.Application
Set OutlookMail = OutlookApp.CreateItem(olMailItem)
With OutlookMail
.BodyFormat = olFormatHTML
.Display
.HTMLBody = "This is a test"
.To = "testemail@gmail.com"
.CC = ""
.BCC = ""
.Subject = "TEST !"
.Attachments.Add = "Location"
.Send
End With
End Sub
Here is what i have written so far.
Sub SendEmail()
'
' SendEmail Macro
'
'
Dim OutlookApp As Outlook.Application
Dim OutlookMail As Outlook.MailItem
Set OutlookApp = New Outlook.Application
Set OutlookMail = OutlookApp.CreateItem(olMailItem)
With OutlookMail
.BodyFormat = olFormatHTML
.Display
.HTMLBody = "This is a test"
.To = "testemail@gmail.com"
.CC = ""
.BCC = ""
.Subject = "TEST !"
.Attachments.Add = "Location"
.Send
End With
End Sub