MailMerge
object which can be accessed via the document.mailMerge
property. This MailMerge
object is present whether or not the document is set up for a mail merge operation (see state
property). state
returns a value of the wdMailMergeState
enumeration which is one of wdNormalDocument | 0 | The document is not used for mail merge |
wdMainDocumentOnly | 1 | Data for mail merge is not attached (data source not specified?) |
wdMainAndDataSource | 2 | Document has an attached data source |
wdMainAndHeader | 3 | Document has an attached data source for the header |
wdMainAndSourceAndHeader | 4 | Combination of wdMainAndDataSource and wdMainAndHeader ? |
wdDataSource | 5 | Data source without main document |
dataSource
returns an instance whose type is MailMergeDataSource
execute
creates the document(s) with the filled in values. execute
if there is an attached MailMergeDataSource
. This can be verified with if activeDocument.mailMerge.state > wdMainDocumentOnly then activeDocument.mailMerge.execute end if
wdCatalog | 3 | |
wdDirectory | 3 | |
wdEMail | 4 | |
wdEnvelopes | 2 | |
wdFax | 5 | |
wdFormLetters | 0 | |
wdMailingLabels | 1 | |
wdNotAMergeDocument | -1 |