DocumentBase.MailMergeWizardSendToCustom Event

Occurs when the custom button is clicked on step six of the Mail Merge Wizard.

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 MailMergeWizardSendToCustom

Use the ShowSendToCustom property to create a custom button on the sixth step of the Mail Merge Wizard.

The following code example executes a merge when you click the custom destination button. This example assumes that you have access to a custom destination button. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentMailMergeWizardSendToCustom()
{
    this.MailMergeWizardSendToCustom += new 
        EventHandler(ThisDocument_MailMergeWizardSendToCustom);
}

void ThisDocument_MailMergeWizardSendToCustom(object sender, EventArgs e)
{
    this.MailMerge.ShowSendToCustom = "Custom Destination";
    this.MailMerge.Destination = Microsoft.Office.Interop
        .Word.WdMailMergeDestination.wdSendToNewDocument;
    this.MailMerge.Execute(ref missing);
}

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