Document.MailMergeDataSourceLoad – událost
Dojde k načtení zdrojových dat pro hromadnou korespondenci.
Obor názvů: Microsoft.Office.Tools.Word
Sestavení: Microsoft.Office.Tools.Word.v4.0.Utilities (v Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
Microsoft.Office.Tools.Word (v Microsoft.Office.Tools.Word.dll)
Syntaxe
'Deklarace
Event MailMergeDataSourceLoad As EventHandler
event EventHandler MailMergeDataSourceLoad
Příklady
Následující příklad zobrazí zprávu při načtení zdroje dat pro hromadnou korespondenci.V tomto příkladu je doplněk aplikační úrovni.
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
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.");
}
Zabezpečení rozhraní .NET Framework
- Plná důvěra přímému volajícímu. Částečně zabezpečený kód nemůže tento člen použít. Další informace naleznete v tématu Používání knihoven z částečně důvěryhodného kódu.