Bill543
asked on
Can I send an HTML file as body text using Outlook.MailItem?
I'm trying to send an HTML file as 'body text' via MS Access vba using the Outlook.MailItem feature.
I'm able to do it fine with the CDO message object as follows:
objMessage.CreateMHTMLBody "file://c|/temp/test.htm"
But when I try to do this with the Outlook message object, I get an error.
I couldn't find a 'CreateMHTMLBody' option using Outlook objects, so I tried:
objMailMessage.HTMLBody "file://c|/temp/test.htm"
But received an error :(
The reason why I'm trying to use Outlook objects instead of CDO is that I want to save to my Outlook drafts folder.
I'm able to do it fine with the CDO message object as follows:
objMessage.CreateMHTMLBody
But when I try to do this with the Outlook message object, I get an error.
I couldn't find a 'CreateMHTMLBody' option using Outlook objects, so I tried:
objMailMessage.HTMLBody "file://c|/temp/test.htm"
But received an error :(
The reason why I'm trying to use Outlook objects instead of CDO is that I want to save to my Outlook drafts folder.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks! As usual you pulled through. Your solution worked for me.
I needed to add/edit the below line from your code:
'select message template for this region
Set olOutlookMsg = olOutlook.CreateItemFromTe mplate _
("i:\outlook\templates\" & Reg & "_Broadcast.oft")
I needed to add/edit the below line from your code:
'select message template for this region
Set olOutlookMsg = olOutlook.CreateItemFromTe
("i:\outlook\templates\" & Reg & "_Broadcast.oft")
OM Gang