Application.MailMergeRecipientListClose event (Publisher)

Fires when the user closes the Mail Merge Recipients dialog box (from the Mail Merge or Email Merge task pane, choose Edit Recipient List). Also fires when the user closes the Catalog Merge Product List dialog box, which opens when the user chooses Edit Product List in the Catalog Merge task pane.

Syntax

expression.MailMergeRecipientListClose (Doc)

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
Doc Required Document The current publication.

Remarks

For more information about using events with the Application object, see Using events with the Application object.

Example

The following Microsoft Visual Basic for Applications (VBA) macro shows how to handle the MailMergeRecipientListClose event. It displays a message notifying the user that the string described earlier was displayed.

Private Sub pubApplication_MailMergeRecipientListClose(ByVal Doc As Document) 
 MsgBox "The Mail Merge Recipients dialog box has closed." 
End Sub

For this event to occur, you must place the following line of code in the General Declarations section of your module.

Private WithEvents pubApplication As Application

You then must run the following initialization procedure.

Public Sub Initialize_pubApplication() 
 Set pubApplication = Publisher.Application 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.