Document.MailMergeAfterMerge 事件
當成功地合併在合併列印中的所有記錄之後發生。
命名空間: Microsoft.Office.Tools.Word
組件: Microsoft.Office.Tools.Word (在 Microsoft.Office.Tools.Word.dll 中)
語法
'宣告
Event MailMergeAfterMerge As MailMergeAfterMergeEventHandler
event MailMergeAfterMergeEventHandler MailMergeAfterMerge
範例
下列程式碼範例會在引發 MailMergeAfterMerge 事件時顯示訊息。 這是應用程式層級增益集的範例。
Private Sub DocumentMailMergeAfterMerge()
Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
AddHandler vstoDoc.MailMergeAfterMerge, AddressOf ThisDocument_MailMergeAfterMerge
End Sub
Private Sub ThisDocument_MailMergeAfterMerge(ByVal sender As Object, ByVal e As _
Microsoft.Office.Tools.Word.MailMergeAfterMergeEventArgs)
Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
System.Windows.Forms.MessageBox.Show("Your mail merge on " & vstoDoc.Name & " is now finished.")
End Sub
private void DocumentMailMergeAfterMerge()
{
Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
vstoDoc.MailMergeAfterMerge += new Microsoft.Office.Tools.Word.MailMergeAfterMergeEventHandler(ThisDocument_MailMergeAfterMerge);
}
void ThisDocument_MailMergeAfterMerge(object sender, Microsoft.Office.Tools.Word.MailMergeAfterMergeEventArgs e)
{
Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
System.Windows.Forms.MessageBox.Show("Your mail merge on "
+ vstoDoc.Name + " is now finished.");
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。