RunLetterWizard 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, 1999", _
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