Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending a formatted email in Access 2016 VBA using Outlook Template

Status
Not open for further replies.

08211987

Programmer
Apr 20, 2012
187
0
0
US
I have this question posted in another area of this forum and didn't get any responses so I am posting it again here.
Hi,
I've been successful in sending emails using Outlook templates (oft) for only text and hyperlinks. But now I have a template that contains a table with images and text in the table and it only creates the email with the text remaining in the email. Is there something else that has to be done in the VBA to have it bring in the whole template as is? Specific fonts and images where they appear?

Thanks!
 
I have decided to just add an attachment to the email in the VBA code so that I can maintain some formatting for the user. But I'd like to maintain the format the text that remains in the template email, such as Bold, font size, text fields that are hyperlinks (now the text is replaced with the fully qualified URL in the body of the email with the <> at beginning and end.

I tried adding .BodyFormat = olFormatHTML but what actually goes in the body of the email is the template itself. I add that by coding:
Set objOutlookMsg = objOutlook.CreatItemFromTemplate(template_email) which is the directory of the .oft file
sample code:
With objOutlookMsg
(set the recipients...
.Subject = "blah, blah, "
.BodyFormat = olFormatHTML
.Attachements.Add (attachment_path
etc, etc

Any ideas would be appreciated! I was really hoping all the formatted information that I originally would have in the body of the template (format and all, including just a regular table format to group instructions) would come through from the template.oft file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top