共用方式為


DocumentBase.MailMergeWizardStateChange 事件

定義

當使用者將 [合併列印精靈] 的某一指定步驟變更為其他指定步驟時發生。

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

事件類型

範例

下列程式代碼範例會在每次您前進到 郵件合併精靈中的下一個步驟時顯示訊息。 若要使用此範例,請從文件層級專案中的 ThisDocument 類別執行它。

private void DocumentMailMergeWizardStateChange()
{
    this.MailMergeWizardStateChange += new Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventHandler(ThisDocument_MailMergeWizardStateChange);
}

void ThisDocument_MailMergeWizardStateChange(object sender, Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventArgs e)
{
    MessageBox.Show("Wizard has moved to next step.");
}
Private Sub DocumentMailMergeWizardStateChange()
    AddHandler Me.MailMergeWizardStateChange, AddressOf ThisDocument_MailMergeWizardStateChange
End Sub

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

備註

Handled 提供的 MailMergeWizardStateChangeEventArgs 屬性設定為 false ,讓用戶維持在目前步驟中。

適用於