Sdílet prostřednictvím


DocumentBase.MailMergeBeforeMerge – událost

Vyvolá se při sloučení je spouštěna dříve, než sloučit všechny záznamy.

Obor názvů:  Microsoft.Office.Tools.Word
Sestavení:  Microsoft.Office.Tools.Word.v4.0.Utilities (v Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntaxe

'Deklarace
Public Event MailMergeBeforeMerge As EventHandler
public event EventHandler MailMergeBeforeMerge

Poznámky

Chcete-li ukončit proces hromadné korespondence, nastaveny Cancel argument poskytované CancelEventArgs k true.

Příklady

Následující příklad kódu zobrazí zprávu před spuštěním jakékoli ruční hromadné korespondence.Chcete-li tento příklad použít, spusťte jej ze třídy ThisDocument v projektu na úrovni dokumentu.

Private Sub DocumentMailMergeBeforeMerge()
    AddHandler Me.MailMergeBeforeMerge, AddressOf ThisDocument_MailMergeBeforeMerge
End Sub

Private Sub ThisDocument_MailMergeBeforeMerge(ByVal sender As Object, ByVal e As EventArgs)
    MessageBox.Show("Your mail merge on " & Me.Name & " is now starting.")
End Sub
private void DocumentMailMergeBeforeMerge()
{
    this.MailMergeBeforeMerge += new EventHandler(ThisDocument_MailMergeBeforeMerge);
}

void ThisDocument_MailMergeBeforeMerge(object sender, EventArgs e)
{
    MessageBox.Show("Your mail merge on "
        + this.Name + " is now starting.");
}

Zabezpečení rozhraní .NET Framework

Viz také

Referenční dokumentace

DocumentBase Třída

Microsoft.Office.Tools.Word – obor názvů