DocumentBase.MailMergeWizardSendToCustom 事件

定义

在“邮件合并向导”的第六步中单击自定义按钮时发生。

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

事件类型

示例

下面的代码示例在单击自定义目标按钮时执行合并。 此示例假定你有权访问自定义目标按钮。 若要使用此示例,请从 ThisDocument 文档级项目中的 类运行它。

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

注解

ShowSendToCustom使用 属性在邮件合并向导的第六步创建自定义按钮。

适用于