Send Access report in Outlook Message Body.
Posted on 2006-05-05
Hello, I am sending an emai message from Access 2003 with an html attachment. (Its a report that was just exported to html). I would like to include the (report) in the body of the message. Not just an attachment. it could be rtf, htm or whatever, just as long as the report in inthe body. The report is not very long. Any help would be greatly appreciated. Thanks!
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
objOutlookAttach = C:\myfile.htm
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
Set objOutlookRecip = objOutlookMsg.Recipients.Add(TheAddress)
objOutlookRecip.Type = olTo
objOutlookMsg.Subject = (Subject)
objOutlookMsg.BodyFormat = olFormatHTML
objOutlookMsg.Body = (MessageBody) ' Here I want to add the contents of myfile.htm
objOutlookMsg.Attachments = AttachmentPath