![]() |
|
|
|
#1
|
||||
|
||||
|
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:
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:
with attempts such as
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 |
|
#2
|
||||
|
||||
|
Mailmerge doesn't automate Outlook, so code like you've posted is irrelevant in that context; you'd have to forego mailmerge entirely and automate Outlook instead, writing your own code for the entire process.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#3
|
||||
|
||||
|
In order to write to the html body, you need to use the Outlook Word Editor Inspector and then you can treat the body as if it was a Word document e.g.
Code:
With olEmail
.BodyFormat = olFormatHTML
Set olInsp = .GetInspector
Set wdDoc = olInsp.WordEditor
Set oRng = wdDoc.Range
oRng.Collapse 1
Or you could simply use http://www.gmayor.com/ManyToOne.htm in one to one mode and merge directly to the message body
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
| Tags |
| .datasource, html body template, mailmerge |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| configure outlook for gmail. cannot pass msg | lortech | Outlook | 0 | 12-15-2015 11:58 PM |
| add hyperlink in body of Outlook email | ChuckDrago | Word | 0 | 06-27-2013 01:13 PM |
Outlook Mailmerge - Application Crash
|
pgrant | Word | 4 | 12-05-2011 04:51 AM |
| Outlook 2007 Application Hang | MTomasco | Outlook | 1 | 06-06-2011 11:53 PM |
| Outlook 2007 Application Hang | outlook_n00b | Outlook | 0 | 03-31-2011 11:19 AM |