DocumentBase.MailMergeBeforeMerge Event


Occurs when a merge is executed, before any records 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 MailMergeBeforeMerge

To stop the mail merge process, set the Cancel argument of the provided CancelEventArgs to true.

The following code example displays a message before any manual mail merge is run. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentMailMergeBeforeMerge()
    this.MailMergeBeforeMerge += new EventHandler(ThisDocument_MailMergeBeforeMerge);

void ThisDocument_MailMergeBeforeMerge(object sender, EventArgs e)
    MessageBox.Show("Your mail merge on "
        + this.Name + " is now starting.");
Return to top