回傳一個 OlEditorType 常數,表示編輯器的類型。 唯讀。
語法
expression。 EditorType
詞 一個代表 Inspector 物件的變數。
註解
自 Microsoft Office Outlook 2007 起,EditorType 屬性一律會傳回 olEditorWord。
範例
這個 Microsoft Visual Basic Scripting Edition (VBScript 範例) 使用 Open 事件來存取項目的 HTMLBody 屬性。 此時會將該項目 Inspector 的 EditorType 屬性設為 olEditorHTML。 若此程式碼置於設計模式下的表單腳本編輯器中,執行時訊息框會反映 EditorType 的變更,因為表單正文的變化。 最後的訊息框利用 ScriptText 屬性在腳本編輯器中顯示所有 VBScript 程式碼。
Function Item_Open()
'Set the HTMLBody of the item.
Item.HTMLBody = "<HTML><H2>My HTML page.</H2><BODY>My body.</BODY></HTML>"
'Item displays HTML message.
Item.Display
'MsgBox shows EditorType is 2 which represents the HTML editor type
MsgBox "HTMLBody EditorType is " & Item.GetInspector.EditorType
'Access the Body and show
'the text of the Body.
MsgBox "This is the Body: " & Item.Body
'After accessing, EditorType
'is still 2.
MsgBox "After accessing, the EditorType is " & Item.GetInspector.EditorType
'Set the item's Body property.
Item.Body = "Back to default body."
'After setting the Body, EditorType is
'still the same.
MsgBox "After setting, the EditorType is " & Item.GetInspector.EditorType
End Function
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。