DocumentBase.MailMergeWizardSendToCustom 事件

定义

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

public event EventHandler MailMergeWizardSendToCustom;

事件类型

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 邮件合并向导" 的第六步中的 "属性" 创建自定义按钮。

适用于