Execute Method

       

Performs the specified mail merge operation.

expression.Execute(Pause)

expression   Required. An expression that returns one of the objects in the Applies To list.

Pause  Required Boolean. True to have Microsoft Publisher pause and display a troubleshooting dialog box if a mail merge error is found. False to ignore errors during mail merge.

Example

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

Sub ExecuteMerge()
    Dim mrgDocument As MailMerge
    Set mrgDocument = ActiveDocument.MailMerge
    If mrgDocument.DataSource.ConnectString <> "" Then
        mrgDocument.Execute Pause:=False
    End If
End Sub