DocumentBase.MailMergeAfterRecordMerge Event

Definition

Occurs after each record in the data source successfully merges in a mail merge.

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

Event Type

Examples

The following code example displays a message when the MailMergeAfterRecordMerge event is raised. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentMailMergeAfterRecordMerge()
{
    this.MailMergeAfterRecordMerge += new EventHandler(ThisDocument_MailMergeAfterRecordMerge);

}

void ThisDocument_MailMergeAfterRecordMerge(object sender, EventArgs e)
{
    object index = 1;
    MessageBox.Show(this.MailMerge.DataSource.DataFields.get_Item(ref index).Value
         + " is finished merging.");
}
Private Sub DocumentMailMergeAfterRecordMerge()
    AddHandler Me.MailMergeAfterRecordMerge, AddressOf ThisDocument_MailMergeAfterRecordMerge
End Sub

Private Sub ThisDocument_MailMergeAfterRecordMerge(ByVal sender As Object, ByVal e As EventArgs)
    Dim index As Object = 1
    MessageBox.Show(Me.MailMerge.DataSource.DataFields.Item(index).Value & _
        " is finished merging.")
End Sub

Applies to