I am automating sending an email from within Access 2007. I can create the email, fill in the To:, Subject: and Body: portions using code (see below) but I also want to insert either a Word doc or a PDF into the body.
------------------------------------------------------------
Public Sub SendFlier(varTo As Variant)
Dim mailItem As Outlook.mailItem
InitOutlook 'Initializes a session in Outlook
Set mailItem = outlookApp.CreateItem(olMailItem)
With mailItem
.To = varTo & ""
.Subject = "Test Subject"
.Body = "This email was automated using MS Access." & Chr(13) & This is where I would like to insert the Word doc or PDF
End With
mailItem.Display
Set mailItem = Nothing
CleanUp 'Cleans up objects
End Sub
---------------------------------------------------------------
Is this possible? So far I haven't figured out a way.
------------------------------------------------------------
Public Sub SendFlier(varTo As Variant)
Dim mailItem As Outlook.mailItem
InitOutlook 'Initializes a session in Outlook
Set mailItem = outlookApp.CreateItem(olMailItem)
With mailItem
.To = varTo & ""
.Subject = "Test Subject"
.Body = "This email was automated using MS Access." & Chr(13) & This is where I would like to insert the Word doc or PDF
End With
mailItem.Display
Set mailItem = Nothing
CleanUp 'Cleans up objects
End Sub
---------------------------------------------------------------
Is this possible? So far I haven't figured out a way.