Udostępnij za pośrednictwem


Zdarzenie DocumentBase.MailMergeDataSourceLoad

Występuje, gdy źródło danych jest ładowany do korespondencji seryjnej.

Przestrzeń nazw:  Microsoft.Office.Tools.Word
Zestaw:  Microsoft.Office.Tools.Word.v4.0.Utilities (w Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Składnia

'Deklaracja
Public Event MailMergeDataSourceLoad As EventHandler
public event EventHandler MailMergeDataSourceLoad

Przykłady

Poniższy przykład wyświetla komunikat, gdy źródło danych dla korespondencji seryjnej jest ładowany.Aby wykorzystać ten przykład, należy uruchomić go z ThisDocument klasy w projekcie na poziomie dokumentu.

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
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.");
}

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

DocumentBase Klasa

Przestrzeń nazw Microsoft.Office.Tools.Word