MailMergeAfterMergeEventHandler 委托

表示处理 DocumentMailMergeAfterMerge 事件的方法。

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

语法

声明
Public Delegate Sub MailMergeAfterMergeEventHandler ( _
    sender As Object, _
    e As MailMergeAfterMergeEventArgs _
)
public delegate void MailMergeAfterMergeEventHandler(
    Object sender,
    MailMergeAfterMergeEventArgs e
)

参数

备注

当创建 MailMergeAfterMergeEventHandler 委托时,将标识处理事件的方法。 若要使该事件与事件处理程序相关联,请将该委托的一个实例添加到事件中。 事件处理程序,每当事件发生,直至移除该委托。

示例

下面的代码示例演示 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 命名空间