共用方式為


MailMergeAfterMergeEventArgs 介面

提供 MailMergeAfterMerge 事件的資料。

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

語法

'宣告
<GuidAttribute("63e99ffe-3adf-47cc-88b4-bca9fba0d9f0")> _
Public Interface MailMergeAfterMergeEventArgs
[GuidAttribute("63e99ffe-3adf-47cc-88b4-bca9fba0d9f0")]
public interface MailMergeAfterMergeEventArgs

MailMergeAfterMergeEventArgs 型別會公開下列成員。

屬性

  名稱 說明
公用屬性 NewDocument 取得從合併列印所建立的 Microsoft.Office.Interop.Word.Document

回頁首

範例

下列程式碼會示範 MailMergeAfterMerge 事件的事件處理常式。 在所有合併列印中的記錄都已經成功合併之後,這個事件處理常式便會顯示一則訊息。

這是示範文件層級自訂的範例。

Private Sub DocumentMailMergeAfterMerge()
    AddHandler Me.MailMergeAfterMerge, AddressOf ThisDocument_MailMergeAfterMerge
End Sub

Private Sub ThisDocument_MailMergeAfterMerge(ByVal sender As Object, ByVal e As  _
    Microsoft.Office.Tools.Word.MailMergeAfterMergeEventArgs)
    MessageBox.Show("Your mail merge on " & Me.Name & " is now finished.")
End Sub
private void DocumentMailMergeAfterMerge()
{
    this.MailMergeAfterMerge += new Microsoft.Office.Tools.Word.MailMergeAfterMergeEventHandler(ThisDocument_MailMergeAfterMerge);
}

void ThisDocument_MailMergeAfterMerge(object sender, Microsoft.Office.Tools.Word.MailMergeAfterMergeEventArgs e)
{
    MessageBox.Show("Your mail merge on " 
        + this.Name + " is now finished.");
}

請參閱

參考

Microsoft.Office.Tools.Word 命名空間