Freigeben über


MailMergeAfterMergeEventArgs Interface

Provides data for the MailMergeAfterMerge event.

Namespace:  Microsoft.Office.Tools.Word
Assemblies:   Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

Syntax

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

The MailMergeAfterMergeEventArgs type exposes the following members.

Properties

  Name Description
Public property NewDocument Gets the Microsoft.Office.Interop.Word.Document created from the mail merge.

Top

Examples

The following code example demonstrates an event handler for the MailMergeAfterMerge event. The event handler displays a message after all records in a mail merge have merged successfully.

This example is for a document-level customization.

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.");
}

See Also

Reference

Microsoft.Office.Tools.Word Namespace