XML 属性

       

返回或设置当前视图的 XML 定义。XML 定义使用一系列与视图本身各种属性对应的标记和关键字来描述视图的类型。创建视图时,通过解析 XML 定义来设置新视图。String 类型,可读写。

expression.XML

expression  必选。该表达式返回 View 对象。

示例

以下示例创建新的视图,并在“立即窗口”中显示其 XML 定义。


Sub XMLView()
'Creates a new view and displays the XML definition
'in the immediate window

    Dim olApp As Outlook.Application
    Dim objViews As Views
    Dim objView As View

    Set olApp = Outlook.Application
    Set objViews = _
    olApp.GetNamespace("mapi").GetDefaultFolder(olFolderInbox).Views
    Set objView = objViews.Add _
       ("New Table View", olTableView, olViewSaveOptionAllFoldersOfType)

    Debug.Print objView.XML

End Sub

修改的属性可在以下 XML 源代码中看到。除了属性定义,XML 源还定义了组成视图的所有对象。以下示例显示上面视图中列的 XML 定义。

<column>
    <heading>Flag Status</heading>
    <prop>http://schemas.microsoft.com/mapi/proptag/0x10900003</prop>
    <type>i4</type>
    <bitmap>1</bitmap>
    <style>padding-left:3px;text-align:center;padding-left:3px</style>
</column>
<column>
    <format>boolicon</format>
    <heading>Attachment</heading>
    <prop>urn:schemas:httpmail:hasattachment</prop>
    <type>boolean</type>
    <bitmap>1</bitmap>
    <style>padding-left:3px;text-align:center;padding-left:3px</style>
    <displayformat>3</displayformat>
</column>