Bagikan melalui


DocumentBase.MailMergeWizardSendToCustom Kejadian

Definisi

Terjadi ketika tombol kustom diklik pada langkah enam panduan Penggabungan Surat.

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

Jenis Acara

Contoh

Contoh kode berikut menjalankan penggabungan saat Anda mengklik tombol tujuan kustom. Contoh ini mengasumsikan bahwa Anda memiliki akses ke tombol tujuan kustom. Untuk menggunakan contoh ini, jalankan dari ThisDocument kelas dalam proyek tingkat dokumen.

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

Keterangan

ShowSendToCustom Gunakan properti untuk membuat tombol kustom pada langkah keenam Panduan Penggabungan Surat.

Berlaku untuk