SetLetterContent Method

Microsoft Word Visual Basic

Inserts the contents of the specified LetterContent object into a document.

expression.SetLetterContent(LetterContent)

expression    Required. An expression that returns a Document object.

LetterContent    Required LetterContent object. The LetterContent object that includes the various elements of the letter.

Remarks

This method is similar to the RunLetterWizard method except that it doesn't display the Letter Wizard dialog box. The method adds, deletes, or restyles letter elements in the specified document based on the contents of the LetterContent object.

Example

This example retrieves the Letter Wizard elements from the active document, changes the attention line text, and then uses the SetLetterContent method to update the active document to reflect the changes.

Set myLetterContent = ActiveDocument.GetLetterContent
myLetterContent.AttentionLine = "Greetings"
ActiveDocument.SetLetterContent LetterContent:=myLetterContent