State Property

Applies To

MailMerge object.

Description

Returns the current state of a mail merge operation. Can be one of the following WdMailMergeState constants: wdNormalDocument, wdMainDocumentOnly, wdMainAndDataSource, wdMainAndHeader, wdMainAndSourceAndHeader, or wdDataSource. Read-only Long.

See Also

MailMerge object, MailMerge property, MainDocumentType property.

Example

This example executes a mail merge if the active document is a main document with an attached data source.

Set myMerge = ActiveDocument.MailMerge
If myMerge.State = wdMainAndDataSource Then myMerge.Execute