Document.MailMergeDataSourceLoad Ereignis
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Wird ausgelöst, wenn die Datenquelle für einen Seriendruck geladen wird.
event EventHandler MailMergeDataSourceLoad;
Ereignistyp
Beispiele
Im folgenden Beispiel wird eine Meldung angezeigt, wenn die Datenquelle für eine e-Mail-Zusammenführung geladen wird. Dieses Beispiel gilt für ein Add-in auf Anwendungsebene.
private void DocumentMailMergeDataSourceLoad()
{
Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
vstoDoc.MailMergeDataSourceLoad += new EventHandler(ThisDocument_MailMergeDataSourceLoad);
}
void ThisDocument_MailMergeDataSourceLoad(object sender, EventArgs e)
{
object index = 1;
Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
System.Windows.Forms.MessageBox.Show(vstoDoc.MailMerge.DataSource.DataFields.get_Item(ref index).Value
+ " is loading.");
}
Private Sub DocumentMailMergeDataSourceLoad()
Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
AddHandler vstoDoc.MailMergeDataSourceLoad, AddressOf ThisDocument_MailMergeDataSourceLoad
End Sub
Private Sub ThisDocument_MailMergeDataSourceLoad(ByVal sender As Object, ByVal e As EventArgs)
Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
Dim index As Object = 1
System.Windows.Forms.MessageBox.Show(vstoDoc.MailMerge.DataSource.DataFields.Item(index).Value & _
" is loading.")
End Sub