Partager via


Document.MailMergeAfterMerge, événement

Se produit lorsque tous les enregistrements d'un publipostage ont fusionné.

Espace de noms :  Microsoft.Office.Tools.Word
Assemblys :   Microsoft.Office.Tools.Word.v4.0.Utilities (dans Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
  Microsoft.Office.Tools.Word (dans Microsoft.Office.Tools.Word.dll)

Syntaxe

'Déclaration
Event MailMergeAfterMerge As MailMergeAfterMergeEventHandler
event MailMergeAfterMergeEventHandler MailMergeAfterMerge

Exemples

L'exemple de code suivant affiche un message lorsque l'événement MailMergeAfterMerge est déclenché. Cet exemple est pour un complément d'application.

Private Sub DocumentMailMergeAfterMerge()
    Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
    AddHandler vstoDoc.MailMergeAfterMerge, AddressOf ThisDocument_MailMergeAfterMerge
End Sub

Private Sub ThisDocument_MailMergeAfterMerge(ByVal sender As Object, ByVal e As  _
    Microsoft.Office.Tools.Word.MailMergeAfterMergeEventArgs)
    Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
    System.Windows.Forms.MessageBox.Show("Your mail merge on " & vstoDoc.Name & " is now finished.")
End Sub
private void DocumentMailMergeAfterMerge()
{
    Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
    vstoDoc.MailMergeAfterMerge += new Microsoft.Office.Tools.Word.MailMergeAfterMergeEventHandler(ThisDocument_MailMergeAfterMerge);
}

void ThisDocument_MailMergeAfterMerge(object sender, Microsoft.Office.Tools.Word.MailMergeAfterMergeEventArgs e)
{
    Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
    System.Windows.Forms.MessageBox.Show("Your mail merge on " 
        + vstoDoc.Name + " is now finished.");
}

Sécurité .NET Framework

Voir aussi

Référence

Document Interface

Microsoft.Office.Tools.Word, espace de noms