會傳回或設定 String,代表指定之項目的 HTML 本文。 讀取/寫入。
語法
expression。 HTMLBody
詞 一個代表 MailItem 物件的變數。
註解
HTMLBody 屬性應該是 HTML 語法字串。
設定 HTMLBody 屬性會立即更新 Body 屬性。
範例
以下 Visual Basic for Applications (VBA) 範例會建立一個新的 MailItem 物件,並將 BodyFormat 屬性設定為 olFormatHTML。 郵件內容的正文現在會以 HTML 格式顯示。
Sub CreateHTMLMail()
'Creates a new email item and modifies its properties.
Dim objMail As Outlook.MailItem
'Create email item
Set objMail = Application.CreateItem(olMailItem)
With objMail
'Set body format to HTML
.BodyFormat = olFormatHTML
.HTMLBody = _
"<HTML><BODY>Enter the message text here. </BODY></HTML>"
.Display
End With
End Sub
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。