共用方式為


DocumentBase.MailMergeDataSourceLoad Event

Definition

Occurs when the data source is loaded for a mail merge.

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

Event Type

Examples

The following example displays a message when the data source for a mail merge is loaded. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentMailMergeDataSourceLoad()
{
    this.MailMergeDataSourceLoad += new EventHandler(ThisDocument_MailMergeDataSourceLoad);
}

void ThisDocument_MailMergeDataSourceLoad(object sender, EventArgs e)
{
    object index = 1;
    MessageBox.Show(this.MailMerge.DataSource.DataFields.get_Item(ref index).Value
         + " is loading.");
}
Private Sub DocumentMailMergeDataSourceLoad()
    AddHandler Me.MailMergeDataSourceLoad, AddressOf ThisDocument_MailMergeDataSourceLoad
End Sub

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

Applies to