WORD Mail Merge and Emailing in HTML C#

M

Mike Kiser

Hello! HELP!

I have spend hours on this and also researching similar probs. I have
my Mail Merge working perfectly and am trying to email out the
completed merged Doc in HTML format (in email body). My code is as
follows. The Error I get is:

"Record 1 could not be mailed because it contained a bad mail address"

THANKS!!! Mike

CODE:

// Perform mail merge.
// wrdMailMerge.Destination =
Word.WdMailMergeDestination.wdSendToNewDocument;

wrdMailMerge.Destination =
Word.WdMailMergeDestination.wdSendToEmail;
wrdApp.ActiveDocument.MailMerge.MailAsAttachment = false;
wrdApp.ActiveDocument.MailMerge.MailAddressFieldName =
"(e-mail address removed)";
wrdApp.ActiveDocument.MailMerge.MailSubject = "test";
wrdMailMerge.MailFormat =
Word.WdMailMergeMailFormat.wdMailFormatHTML;
wrdApp.ActiveDocument.MailMerge.SuppressBlankLines =
false;

wrdMailMerge.Execute(ref oFalse);

// Close the original form document.
wrdDoc.Saved = true;
wrdDoc.Close(ref oFalse, ref oMissing, ref oMissing);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top