共用方式為


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使用 屬性,在郵件合併精靈的第六個步驟上建立自定義按鈕。

適用於