RunLetterWizard Method

Applies To

Document object.

Description

Runs the Letter Wizard on the specified document.

Syntax

expression.RunLetterWizard(LetterContent, WizardMode)

expression Required. An expression that returns a Document object.

LetterContent Optional Variant. A LetterContent object. Any filled properties in the LetterContent object show up as prefilled elements in the Letter Wizard dialog boxes. If this argument is omitted, the GetLetterContent method is automatically used to get a LetterContent object from the specified document.

WizardMode Optional Variant. True to display the Letter Wizard dialog box as a series of steps with a Next, Back, and Finish button. False to display the Letter Wizard dialog box as if it were opened from the Tools menu (a properties dialog box with an OK button and a Cancel button). The default value is False.

Remarks

Use the CreateLetterContent method to return a LetterContent object, given various letter element properties. Use the GetLetterContent method to return a LetterContent object based on the contents of the specified document. You can use the resulting LetterContent object with the RunLetterWizard method to preset elements in the Letter Wizard dialog box.

See Also

CreateLetterContent method, GetLetterContent method, SetLetterContent method.

Example

This example creates a new LetterContent object, sets several properties for it, and then runs the Letter Wizard by using the RunLetterWizard method.

Set myContent = New LetterContent
With myContent
    .Salutation ="Hello"
    .SalutationType = wdSalutationOther
    .SenderName = Application.UserName
    .SenderInitials =Application.UserInitials
End With
Documents.Add.RunLetterWizard LetterContent:=myContent, WizardMode:=True
The following example uses the CreateLetterContent method to create a new LetterContent object in the active document, and then it uses this object with the RunLetterWizard method.

Set myLetter = ActiveDocument.CreateLetterContent(DateFormat:="July 31, 1996", _
    IncludeHeaderFooter:=False, _
    PageDesign:="C:\MSOffice\Templates\Letters & Faxes\Contemporary Letter.dot", _
    LetterStyle:=wdFullBlock, Letterhead:=True, LetterheadLocation:=wdLetterTop, _
    LetterheadSize:=InchesToPoints(1.5), RecipientName:="Dave Edson", _
    RecipientAddress:="436 SE Main St." & vbCr & "Bellevue, WA 98004", _
    Salutation:="Dear Dave,", SalutationType:=wdSalutationInformal, _
    RecipientReference:="", MailingInstructions:="", AttentionLine:="", _
    Subject:="End of year report", CCList:="", ReturnAddress:="", _
    SenderName:="", Closing:="Sincerely yours,", SenderCompany:="", _
    SenderJobTitle:="", SenderInitials:="", EnclosureNumber:=0)
ActiveDocument.RunLetterWizard LetterContent:=myLetter