_Document.CreateLetterContent Method
Creates and returns a LetterContent object based on the specified letter elements.
Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)
Syntax
'Declaration
Function CreateLetterContent ( _
DateFormat As String, _
IncludeHeaderFooter As Boolean, _
PageDesign As String, _
LetterStyle As WdLetterStyle, _
Letterhead As Boolean, _
LetterheadLocation As WdLetterheadLocation, _
LetterheadSize As Single, _
RecipientName As String, _
RecipientAddress As String, _
Salutation As String, _
SalutationType As WdSalutationType, _
RecipientReference As String, _
MailingInstructions As String, _
AttentionLine As String, _
Subject As String, _
CCList As String, _
ReturnAddress As String, _
SenderName As String, _
Closing As String, _
SenderCompany As String, _
SenderJobTitle As String, _
SenderInitials As String, _
EnclosureNumber As Integer, _
ByRef InfoBlock As Object, _
ByRef RecipientCode As Object, _
ByRef RecipientGender As Object, _
ByRef ReturnAddressShortForm As Object, _
ByRef SenderCity As Object, _
ByRef SenderCode As Object, _
ByRef SenderGender As Object, _
ByRef SenderReference As Object _
) As LetterContent
'Usage
Dim instance As _Document
Dim DateFormat As String
Dim IncludeHeaderFooter As Boolean
Dim PageDesign As String
Dim LetterStyle As WdLetterStyle
Dim Letterhead As Boolean
Dim LetterheadLocation As WdLetterheadLocation
Dim LetterheadSize As Single
Dim RecipientName As String
Dim RecipientAddress As String
Dim Salutation As String
Dim SalutationType As WdSalutationType
Dim RecipientReference As String
Dim MailingInstructions As String
Dim AttentionLine As String
Dim Subject As String
Dim CCList As String
Dim ReturnAddress As String
Dim SenderName As String
Dim Closing As String
Dim SenderCompany As String
Dim SenderJobTitle As String
Dim SenderInitials As String
Dim EnclosureNumber As Integer
Dim InfoBlock As Object
Dim RecipientCode As Object
Dim RecipientGender As Object
Dim ReturnAddressShortForm As Object
Dim SenderCity As Object
Dim SenderCode As Object
Dim SenderGender As Object
Dim SenderReference As Object
Dim returnValue As LetterContent
returnValue = instance.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)
LetterContent CreateLetterContent(
string DateFormat,
bool IncludeHeaderFooter,
string PageDesign,
WdLetterStyle LetterStyle,
bool Letterhead,
WdLetterheadLocation LetterheadLocation,
float LetterheadSize,
string RecipientName,
string RecipientAddress,
string Salutation,
WdSalutationType SalutationType,
string RecipientReference,
string MailingInstructions,
string AttentionLine,
string Subject,
string CCList,
string ReturnAddress,
string SenderName,
string Closing,
string SenderCompany,
string SenderJobTitle,
string SenderInitials,
int EnclosureNumber,
ref Object InfoBlock,
ref Object RecipientCode,
ref Object RecipientGender,
ref Object ReturnAddressShortForm,
ref Object SenderCity,
ref Object SenderCode,
ref Object SenderGender,
ref Object SenderReference
)
Parameters
- DateFormat
Type: System.String
Required String. The date for the letter.
- IncludeHeaderFooter
Type: System.Boolean
Required Boolean. True to include the header and footer from the page design template.
- PageDesign
Type: System.String
Required String. The name of the template attached to the document.
- LetterStyle
Type: Microsoft.Office.Interop.Word.WdLetterStyle
Required WdLetterStyle. The document layout.
- Letterhead
Type: System.Boolean
Required Boolean. True to reserve space for a preprinted letterhead.
- LetterheadLocation
Type: Microsoft.Office.Interop.Word.WdLetterheadLocation
Required WdLetterheadLocation. The location of the preprinted letterhead.
- LetterheadSize
Type: System.Single
Required Single. The amount of space (in points) to be reserved for a preprinted letterhead.
- RecipientName
Type: System.String
Required String. The name of the person who'll be receiving the letter.
- RecipientAddress
Type: System.String
Required String. The mailing address of the person who'll be receiving the letter.
- Salutation
Type: System.String
Required String. The salutation text for the letter.
- SalutationType
Type: Microsoft.Office.Interop.Word.WdSalutationType
Required WdSalutationType. The salutation type for the letter.
- RecipientReference
Type: System.String
Required String. The reference line text for the letter (for example, "In reply to:").
- MailingInstructions
Type: System.String
Required String. The mailing instruction text for the letter (for example, "Certified Mail").
- AttentionLine
Type: System.String
Required String. The attention line text for the letter (for example, "Attention:").
- Subject
Type: System.String
Required String. The subject text for the specified letter.
- CCList
Type: System.String
Required String. The names of the carbon copy (CC) recipients for the letter.
- ReturnAddress
Type: System.String
Required String. The text of the return mailing address for the letter.
- SenderName
Type: System.String
Required String. The name of the person sending the letter.
- Closing
Type: System.String
Required String. The closing text for the letter.
- SenderCompany
Type: System.String
Required String. The company name of the person creating the letter.
- SenderJobTitle
Type: System.String
Required String. The job title of the person creating the letter.
- SenderInitials
Type: System.String
Required String. The initials of the person creating the letter.
- EnclosureNumber
Type: System.Int32
Required Integer. The number of enclosures for the letter.
- InfoBlock
Type: System.Object%
Optional Object. This argument may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.
- RecipientCode
Type: System.Object%
Optional Object. This argument may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.
- RecipientGender
Type: System.Object%
Optional Object. This argument may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.
- ReturnAddressShortForm
Type: System.Object%
Optional Object. This argument may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.
- SenderCity
Type: System.Object%
Optional Object. This argument may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.
- SenderCode
Type: System.Object%
Optional Object. This argument may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.
- SenderGender
Type: System.Object%
Optional Object. This argument may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.
- SenderReference
Type: System.Object%
Optional Object. This argument may not be available to you, depending on the language support (U.S. English, for example) that you’ve selected or installed.
Return Value
Type: Microsoft.Office.Interop.Word.LetterContent