Sdílet prostřednictvím


Document.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)
  Microsoft.Office.Tools.Word (v Microsoft.Office.Tools.Word.dll)

Syntaxe

'Deklarace
Event MailMergeBeforeMerge As EventHandler
event EventHandler MailMergeBeforeMerge

Poznámky

Chcete-li zastavit proces hromadné korespondence, nastavte 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.V tomto příkladu je aplikace úroveň doplněk.

Private Sub DocumentMailMergeBeforeMerge()
    Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
    AddHandler vstoDoc.MailMergeBeforeMerge, AddressOf ThisDocument_MailMergeBeforeMerge
End Sub

Private Sub ThisDocument_MailMergeBeforeMerge(ByVal sender As Object, ByVal e As EventArgs)
    Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
    System.Windows.Forms.MessageBox.Show("Your mail merge on " & vstoDoc.Name & " is now starting.")
End Sub
private void DocumentMailMergeBeforeMerge()
{
    Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
    vstoDoc.MailMergeBeforeMerge += new EventHandler(ThisDocument_MailMergeBeforeMerge);
}

void ThisDocument_MailMergeBeforeMerge(object sender, EventArgs e)
{
    Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
    System.Windows.Forms.MessageBox.Show("Your mail merge on "
        + vstoDoc.Name + " is now starting.");
}

Zabezpečení rozhraní .NET Framework

Viz také

Referenční dokumentace

Document Rozhraní

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