Document.MailMergeWizardStateChange 事件

定义

当用户在“邮件合并向导”中从指定的步骤切换到另一个指定步骤时发生。

public:
 event Microsoft::Office::Tools::Word::MailMergeWizardStateChangeEventHandler ^ MailMergeWizardStateChange;
event Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventHandler MailMergeWizardStateChange;
member this.MailMergeWizardStateChange : Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventHandler 
Event MailMergeWizardStateChange As MailMergeWizardStateChangeEventHandler 

事件类型

示例

下面的代码示例在每次前进到 邮件合并向导中的下一步时都会显示一条消息。 此示例适用于应用程序级外接程序。

private void DocumentMailMergeWizardStateChange()
{
    Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
    vstoDoc.MailMergeWizardStateChange += new Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventHandler(ThisDocument_MailMergeWizardStateChange);
}

void ThisDocument_MailMergeWizardStateChange(object sender, Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventArgs e)
{
    System.Windows.Forms.MessageBox.Show("Wizard has moved to next step.");
}
Private Sub DocumentMailMergeWizardStateChange()
    Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
    AddHandler vstoDoc.MailMergeWizardStateChange, AddressOf ThisDocument_MailMergeWizardStateChange
End Sub

Private Sub ThisDocument_MailMergeWizardStateChange(ByVal sender As Object, ByVal e As Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventArgs)
    System.Windows.Forms.MessageBox.Show("Wizard has moved to next step.")
End Sub

注解

Handled 提供的 MailMergeWizardStateChangeEventArgs 的 属性设置为 false 使用户保持当前步骤。

适用于