MailMergeWizardStateChangeEventHandler Delegate (2007 System)
Represents the method that handles the MailMergeWizardStateChange event of a Document.
This API is not CLS-compliant.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax
'Declaration
<CLSCompliantAttribute(False)> _
Public Delegate Sub MailMergeWizardStateChangeEventHandler ( _
sender As Object, _
e As MailMergeWizardStateChangeEventArgs _
)
'Usage
Dim instance As New MailMergeWizardStateChangeEventHandler(AddressOf HandlerMethod)
[CLSCompliantAttribute(false)]
public delegate void MailMergeWizardStateChangeEventHandler(
Object sender,
MailMergeWizardStateChangeEventArgs e
)
[CLSCompliantAttribute(false)]
public delegate void MailMergeWizardStateChangeEventHandler(
Object^ sender,
MailMergeWizardStateChangeEventArgs^ e
)
JScript does not support delegates.
Parameters
sender
Type: System.ObjectThe source of the event.
e
Type: Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventArgsA MailMergeWizardStateChangeEventArgs that contains the event data.
Remarks
When you create a MailMergeWizardStateChangeEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, until you remove the delegate. For more information about delegates, see Events and Delegates.
Examples
The following code example demonstrates an event handler for the MailMergeWizardStateChange event. The event handler displays a message each time the user advances to the next step in the Mail Merge wizard.
This example is for a document-level customization.
Private Sub DocumentMailMergeWizardStateChange()
AddHandler Me.MailMergeWizardStateChange, AddressOf ThisDocument_MailMergeWizardStateChange
End Sub
Private Sub ThisDocument_MailMergeWizardStateChange(ByVal sender As Object, ByVal e As Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventArgs)
MessageBox.Show("Wizard has moved to next step.")
End Sub
private void DocumentMailMergeWizardStateChange()
{
this.MailMergeWizardStateChange += new Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventHandler(ThisDocument_MailMergeWizardStateChange);
}
void ThisDocument_MailMergeWizardStateChange(object sender, Microsoft.Office.Tools.Word.MailMergeWizardStateChangeEventArgs e)
{
MessageBox.Show("Wizard has moved to next step.");
}