共用方式為


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 命名空間