Document.MailMergeWizardStateChange 事件

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

命名空间:  Microsoft.Office.Tools.Word
程序集:   Microsoft.Office.Tools.Word.v4.0.Utilities(在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)
  Microsoft.Office.Tools.Word(在 Microsoft.Office.Tools.Word.dll 中)

语法

声明
Event MailMergeWizardStateChange As MailMergeWizardStateChangeEventHandler
event MailMergeWizardStateChangeEventHandler MailMergeWizardStateChange

备注

如果将所提供的 MailMergeWizardStateChangeEventArgsHandled 属性设置为 false,则会让用户停留在当前步骤。

示例

下面的代码示例在您每次在**“邮件合并向导”**中前移到下一个步骤时显示一条消息。 此示例针对的是应用程序级外接程序。

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
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.");
}

.NET Framework 安全性

请参见

参考

Document 接口

Microsoft.Office.Tools.Word 命名空间