Table of contents
Collapse the table of content
Expand the table of content

Application.MailMergeWizardStateChange Event (Publisher)

office 365 dev account|Last Updated: 8/24/2017
3 Contributors

Occurs when a user changes from a specified step to a specified step in the Mail Merge Wizard.


expression. MailMergeWizardStateChange( Doc, FromState)

_expression_A variable that represents an Application object.


NameRequired/OptionalData TypeDescription
DocRequiredDocumentThe mail merge main document.
FromStateRequiredIntegerThe Mail Merge Wizard step from which a user is moving.


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.


This example displays a message when a users moves from step three of the Mail Merge Wizard to step four. Based on the user's answer to the message, the user will either continue on to step four or return to step three.

Private Sub MailMergeApp_MailMergeWizardStateChange(ByVal Doc As Document, _ 
 ByVal FromState As Long) 

 Select Case FromState 
 Case 1 
 MsgBox "Now you will build your publication merge " &; _ 
 "by adding fields to your publication." 
 Case 2 
 MsgBox "Now you will see your publication " &; _ 
 "merged with the records in the data source." 
 Case 3 
 MsgBox "Now you will complete the mail merge process." 
 End Select 

End Sub

See also


Application Object

© 2018 Microsoft