Share via


DocumentBase.MailMergeWizardSendToCustom Event

Definition

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

public:
 event EventHandler ^ MailMergeWizardSendToCustom;
public event EventHandler MailMergeWizardSendToCustom;
member this.MailMergeWizardSendToCustom : EventHandler 
Public Custom Event MailMergeWizardSendToCustom As EventHandler 

Event Type

Examples

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);
}
Private Sub DocumentMailMergeWizardSendToCustom()
    AddHandler Me.MailMergeWizardSendToCustom, AddressOf ThisDocument_MailMergeWizardSendToCustom
End Sub

Private Sub ThisDocument_MailMergeWizardSendToCustom(ByVal sender As Object, ByVal e As EventArgs)
    Me.MailMerge.ShowSendToCustom = "Custom Destination"
    Me.MailMerge.Destination = Microsoft.Office.Interop.Word.WdMailMergeDestination. _
        wdSendToNewDocument
    Me.MailMerge.Execute()
End Sub

Remarks

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

Applies to