View Single Post
 
Old 03-11-2019, 09:21 AM
Wordeo Wordeo is offline Windows 10 Office 2016
Novice
 
Join Date: Feb 2019
Posts: 1
Wordeo is on a distinguished road
Default Pass Mailmerge body to Outlook Application

I'm working off of mailmerge VBA code that uses .MailMerge


now I'm passing values to from .MailMerge to field fields in Outlook.MailItem because I find it easier to reference the column using .MailItem


for example:


Quote:
myItem.To = ("email")
myItem.Subject = ("Probationary Period

I'm trying to fill out .HTMLBody but it won't compile because I don't know how to use the mailmerge email body as a string or an html from .MailMerge that I can forward to .body or .HTMLbody for Outlook.Application / Outlook.MailItem




These my attempts so far:


declaring



Quote:
Dim myItem As Outlook.MailItem

with attempts such as



  1. Quote:
    myItem.HTMLBody = .DataSource & myItem.Body
  2. Quote:
    myItem.HTMLBody = .DataSource






If I can somehow use the MailMerge method to pass the the mail merge document to the body of the Outlook method it would really save me a lot of time


Please advise
Reply With Quote