CreateLetterContent Method
Applies To
Document object.
Description
Creates and returns a LetterContent object based on the specified letter elements.
Syntax
expression.CreateLetterContent(DateFormat, IncludeHeaderFooter, PageDesign,
ú LetterStyle, Letterhead, LetterheadLocation, LetterheadSize, RecipientName,
ú RecipientAddress, Salutation, SalutationType, RecipientReference,
ú MailingInstructions, AttentionLine, Subject, CCList, ReturnAddress, SenderName,
ú Closing, SenderCompany, SenderJobTitle, SenderInitials, EnclosureNumber,
ú InfoBlock, RecipientCode, RecipientGender, ReturnAddressShortForm,
ú SenderCity, SenderCode, SenderGender, SenderReference)
expression An expression that returns a Document object.
DateFormat Required String. The date for the letter.
IncludeHeaderFooter Required Boolean. True to include the header and footer from the page design template.
PageDesign Required String. The name of the template attached to the document.
LetterStyle Required Long. The document layout. Can be one of the following WdLetterStyle constants: wdFullBlock, wdModifiedBlock, or wdSemiBlock.
Letterhead Required Boolean. True to reserve space for a preprinted letterhead.
LetterheadLocation Required Long. The location of the preprinted letterhead. Can be one of the following WdLetterheadLocation constants: wdLetterBottom, wdLetterLeft, wdLetterRight, or wdLetterTop.
LetterheadSize Required Single. The amount of space (in points) to be reserved for a preprinted letterhead.
RecipientName Required String. The name of the person who'll be receiving the letter.
RecipientAddress Required String. The mailing address of the person who'll be receiving the letter.
Salutation Required String. The salutation text for the letter.
SalutationType Required Long. The salutation type for the letter. Can be one of the following WdSalutationType constants: wdSalutationBusiness, wdSalutationFormat, wdSalutationInformal, or wdSalutationOther.
RecipientReference Required String. The reference line text for the letter (for example, "In reply to:").
MailingInstructions Required String. The mailing instruction text for the letter (for example, "Certified Mail").
AttentionLine Required String. The attention line text for the letter (for example, "Attention:").
Subject Required String. The subject text for the specified letter.
CCList Required String. The names of the carbon copy (CC) recipients for the letter.
ReturnAddress Required String. The text of the return mailing address for the letter.
SenderName Required String. The name of the person sending the letter.
Closing Required String. The closing text for the letter.
SenderCompany Required String. The company name of the person creating the letter.
SenderJobTitle Required String. The job title of the person creating the letter.
SenderInitials Required String. The initials of the person creating the letter.
EnclosureNumber Required Long. The number of enclosures for the letter.
InfoBlock Optional Variant. Not used in the U.S. English version of Word.
RecipientCode Optional Variant. Not used in the U.S. English version of Word.
RecipientGender Optional Variant. Not used in the U.S. English version of Word.
ReturnAddressShortForm Optional Variant. Not used in the U.S. English version of Word.
SenderCity Optional Variant. Not used in the U.S. English version of Word.
SenderCode Optional Variant. Not used in the U.S. English version of Word.
SenderGender Optional Variant. Not used in the U.S. English version of Word.
SenderReference Optional Variant. Not used in the U.S. English version of Word.
See Also
RunLetterWizard method.
Example
The following example uses the CreateLetterContent method to create a new LetterContent object in the active document and then uses this object with the RunLetterWizard method.
Set myLetter = ActiveDocument.CreateLetterContent(DateFormat:="July 31, 1996", _
IncludeHeaderFooter:=False, PageDesign:="", _
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