Table of contents

Application.MailMergeWizardStateChange 事件 (发布服务器)Application.MailMergeWizardStateChange Event (Publisher)

office 365 dev account|上次更新日期: 2018/3/13
3 参与人员

当用户在“邮件合并向导”中从一个指定步骤切换到另一个指定步骤时发生。Occurs when a user changes from a specified step to a specified step in the Mail Merge Wizard.


表达式MailMergeWizardStateChange(文档FromState)expression. MailMergeWizardStateChange( Doc, FromState)

表示一个应用程序对象的 _expression_A 变量。_expression_A variable that represents an Application object.


名称Name必需/可选Required/Optional数据类型Data Type说明Description
DocDoc必需RequiredDocumentDocument邮件合并主文档。The mail merge main document.
FromStateFromState必需RequiredIntegerInteger用户开始移动的“邮件合并向导”步骤。The 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.


本示例在用户从“邮件合并向导”中的步骤 3 转到步骤 4 时显示一个消息。根据用户对消息的响应,可以继续步骤 4 或返回步骤 3。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 对象Application Object

© 2018 Microsoft