共用方式為


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 ,讓使用者保留在目前步驟中。

適用於