共用方式為


MailMergeAfterMergeEventArgs Interface

Definition

Provides data for the MailMergeAfterMerge event.

public interface class MailMergeAfterMergeEventArgs
[System.Runtime.InteropServices.Guid("63e99ffe-3adf-47cc-88b4-bca9fba0d9f0")]
public interface MailMergeAfterMergeEventArgs
[<System.Runtime.InteropServices.Guid("63e99ffe-3adf-47cc-88b4-bca9fba0d9f0")>]
type MailMergeAfterMergeEventArgs = interface
Public Interface MailMergeAfterMergeEventArgs
Attributes

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

Properties

NewDocument

Gets the Document created from the mail merge.

Applies to