Document.MailMergeWizardStateChange 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当用户在“邮件合并向导”中从指定的步骤切换到另一个指定步骤时发生。
public:
event Microsoft::Office::Tools::Word::MailMergeWizardStateChangeEventHandler ^ MailMergeWizardStateChange;
event Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventHandler MailMergeWizardStateChange;
member this.MailMergeWizardStateChange : Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventHandler
Event MailMergeWizardStateChange As MailMergeWizardStateChangeEventHandler
事件类型
示例
下面的代码示例在每次前进到 邮件合并向导中的下一步时都会显示一条消息。 此示例适用于应用程序级外接程序。
private void DocumentMailMergeWizardStateChange()
{
Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
vstoDoc.MailMergeWizardStateChange += new Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventHandler(ThisDocument_MailMergeWizardStateChange);
}
void ThisDocument_MailMergeWizardStateChange(object sender, Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventArgs e)
{
System.Windows.Forms.MessageBox.Show("Wizard has moved to next step.");
}
Private Sub DocumentMailMergeWizardStateChange()
Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
AddHandler vstoDoc.MailMergeWizardStateChange, AddressOf ThisDocument_MailMergeWizardStateChange
End Sub
Private Sub ThisDocument_MailMergeWizardStateChange(ByVal sender As Object, ByVal e As Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventArgs)
System.Windows.Forms.MessageBox.Show("Wizard has moved to next step.")
End Sub
注解
将 Handled 提供的 MailMergeWizardStateChangeEventArgs 的 属性设置为 false
使用户保持当前步骤。