DocumentBase.MailMergeAfterRecordMerge Event

Occurs after each record in the data source successfully merges in a mail merge.

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

public event EventHandler MailMergeAfterRecordMerge

The following code example displays a message when the MailMergeAfterRecordMerge event is raised. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentMailMergeAfterRecordMerge()
{
    this.MailMergeAfterRecordMerge += new EventHandler(ThisDocument_MailMergeAfterRecordMerge);

}

void ThisDocument_MailMergeAfterRecordMerge(object sender, EventArgs e)
{
    object index = 1;
    MessageBox.Show(this.MailMerge.DataSource.DataFields.get_Item(ref index).Value
         + " is finished merging.");
}

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft