MailMergeAddressFieldName Element (Microsoft Word)

Specifies a data field that contains the e-mail or fax address destination when merging to an e-mail or fax document.

Contained In

WordDocument

Remarks

Contains the name of the data field with the destination e-mail or fax address. This element requires that the MailMergeDestination element contain the value Email or Fax.

See Also

MailMergeActiveRecord, MailMergeAsAttachment, MailMergeCheckErrors, MailMergeConnectString, MailMergeDataSource, MailMergeDataType, MailMergeDestination, MailMergeDoNotSuppressBlankLines, MailMergeHeaderSource, MailMergeLinkToQuery, MailMergeMailSubject, MailMergeMainDocType, MailMergeQueryString, MailMergeViewMergedData

Example

This is an example of a mail merge document linked by means of ODBC to a Microsoft Excel data source with a separate header source file. The destination of the mail merge is an attachment to an e-mail message, which is sent to each address listed in the EmailAddress field.

 <w:WordDocument>
  <w:MailMergeMainDocType>FormLetters</w:MailMergeMainDocType>
  <w:MailMergeLinkToQuery/>
  <w:MailMergeDataType>ODBC</w:MailMergeDataType>
  <w:MailMergeConnectString>DSN=Excel Files;DBQ=C:\My Documents\contacts.xls;DriverId=22;MaxBufferSize=2048;PageTimeout=5;</w:MailMergeConnectString>
  <w:MailMergeQueryString>SELECT * FROM `Contacts`</w:MailMergeQueryString>
  <w:MailMergeDataSource HRef="C:\My Documents\contacts.xls"></w:MailMergeDataSource>
  <w:MailMergeHeaderSource HRef="C:\My Documents\head.xls"></w:MailMergeHeaderSource>
  <w:MailMergeDoNotSuppressBlankLines/>
  <w:MailMergeDestination>Email</w:MailMergeDestination>
  <w:MailMergeMailAddressFieldName>EmailAddress</w:MailMergeMailAddressFieldName>
  <w:MailMergeMailSubject>New Product</w:MailMergeMailSubject>
  <w:MailMergeMailAsAttachment/>
  <w:MailMergeViewMergedData/>
  <w:MailMergeCheckErrors>3</w:MailMergeCheckErrors>
 </w:WordDocument>