MailMerge.WizardState property (Word)

Returns or sets a Long indicating the current Mail Merge Wizard step for a document. The WizardState method returns a number that equates to the current Mail Merge Wizard step; a zero (0) means the Mail Merge Wizard is closed. Read/write.

Syntax

expression. WizardState

expression A variable that represents a 'MailMerge' object.

Example

This example checks if the Mail Merge Wizard is already displayed in the active document and if it is, moves to the Mail Merge Wizard's sixth step and removes the fifth step from the Wizard.

Sub ShowMergeWizard() 
 With ActiveDocument.MailMerge 
 If .WizardState > 0 Then 
 .ShowWizard InitialState:=6, ShowPreviewStep:=False 
 End If 
 End With 
End Sub

See also

MailMerge Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.