Word) (Document.CreateLetterContent 方法

建立並傳回 LetterContent 物件根據指定的字母項目。 LetterContent 物件。

語法

expressionCreateLetterContent( _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。 代表 Document 物件的變數。

參數

名稱 必要/選用 資料類型 描述
DateFormat 必要 String 信件的日期。
IncludeHeaderFooter 必要 Boolean True 是表示 包括頁首和頁尾版面設計範本中。
PageDesign 必要 String 附加至文件的範本名稱。
LetterStyle 必要 WdLetterStyle 文件版面配置。
Letterhead 必要 Boolean True 保留空間列印的信紙信頭。
LetterheadLocation 必要 WdLetterheadLocation 預先列印之信紙信頭的位置。
LetterheadSize 必要 Single 要為預先列印之信紙信頭保留多少空間 (以點為單位)。
RecipientName 必要 String 將會收到信件之人員的名稱。
RecipientAddress 必要 String 將會收到信件之人員的地址。
Salutation 必要 String 信件的問候語文字。
SalutationType 必要 WdSalutationType 信件的問候語類型。
RecipientReference 必要 String 信件的附件列文字 (例如 "In reply to:")。
MailingInstructions 必要 String 信件的郵件類型文字 (例如 "Certified Mail")。
AttentionLine 必要 String 信件的指定受文行文字 (例如 "Attention:")。
Subject 必要 String 指定信件的主旨文字。
CCList 必要 String 信件之副本 (CC) 收件者的名稱。
ReturnAddress 必要 String 信件之回信地址的文字。
SenderName 必要 String 寄送信件之人員的名稱。
Closing 必要 String 信件的結語文字。
SenderCompany 必要 String 建立信件之人員的公司名稱。
SenderJobTitle 必要 String 建立信件之人員的職稱。
SenderInitials 必要 String 建立信件之人員的縮寫。
EnclosureNumber 必要 Long 信件的隨函附件數目。
InfoBlock 選用 Variant 此引數可能無法使用時,根據您所選取或安裝的語言支援 (例如 US English)。
RecipientCode 選用 Variant 此引數可能無法使用時,根據您所選取或安裝的語言支援 (例如 US English)。
RecipientGender 選用 Variant 此引數可能無法使用時,根據您所選取或安裝的語言支援 (例如 US English)。
ReturnAddressShortForm 選用 Variant 此引數可能無法使用時,根據您所選取或安裝的語言支援 (例如 US English)。
SenderCity 選用 Variant 此引數可能無法使用時,根據您所選取或安裝的語言支援 (例如 US English)。
SenderCode 選用 Variant 此引數可能無法使用時,根據您所選取或安裝的語言支援 (例如 US English)。
SenderGender 選用 Variant 此引數可能無法使用時,根據您所選取或安裝的語言支援 (例如 US English)。
SenderReference 選用 Variant 此引數可能無法使用時,根據您所選取或安裝的語言支援 (例如 US English)。

傳回值

LetterContent

範例

下列範例會使用 CreateLetterContent 方法在使用中文件中建立新的 LetterContent 物件並再使用此物件搭配 RunLetterWizard 方法。

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

另請參閱

Document 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應