Application.MailMergeBeforeMerge Event
Publisher Developer Reference |
Occurs when a merge is executed before any records in a mail merge have merged.
Syntax
expression.MailMergeBeforeMerge(Doc, StartRecord, EndRecord, Cancel)
expression A variable that represents an Application object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Doc | Required | Document | The mail merge main document. |
StartRecord | Required | Long | The first record in the data source to include in the mail merge. |
EndRecord | Required | Long | The last record in the data source to include in the mail merge. |
Cancel | Required | Boolean | Stops the mail merge process before it starts. |
Remarks
To access the Application object events, declare an Application object variable in the General Declarations section of a code module. Then set the variable equal to the Application object for which you want to access events. For information about using events with the Microsoft Office Publisher Application object, see Using Events with the Application Object.
Example
This example displays a message before the mail merge process begins, asking the user if they want to continue. If the user clicks No, the merge process is canceled.
Visual Basic for Applications |
---|
|
See Also