Outlook) (OrderField 对象

代表用于对视图中的信息进行排序的顺序字段。

备注

使用 OrderFields 对象的 Add 方法将 Outlook 项属性添加到 View 对象派生的下列对象的 SortFields 集合中:

使用 ViewXMLSchemaName 属性可以获取视图的 XML 定义中所引用的顺序字段的名称。

OrderFieldOrderFields 集合中包含的对象应用于 Outlook 项显示在视图中的对象包含在集合中的顺序。 对于每个 OrderField 对象,使用 IsDescending 属性来确定是否按升序或降序 order 域的内容进行排序。

示例

(VBA) 示例下面的 Visual Basic for Applications 循环 SortFields 集合的当前的 表 对象在集合中显示的标签和 XML 架构的每个 OrderField 对象的名称。

Private Sub DisplayTableViewSortFields() 
 
 Dim objTableView As TableView 
 
 Dim objOrderField As OrderField 
 
 Dim strOutput As String 
 
 
 
 If Application.ActiveExplorer.CurrentView.ViewType = _ 
 
 olTableView Then 
 
 
 
 ' Obtain a TableView object reference for the 
 
 ' current table view. 
 
 Set objTableView = _ 
 
 Application.ActiveExplorer.CurrentView 
 
 
 
 ' Iterate through the OrderFields collection for 
 
 ' the table view, obtaining the label and the 
 
 ' XML schema name for each field used to sort 
 
 ' the items in the view. 
 
 For Each objOrderField In objTableView.SortFields 
 
 With objOrderField 
 
 strOutput = strOutput & .ColumnFormat.Label & _ 
 
 " (" & .ViewXMLSchemaName & ")" & vbCrLf 
 
 End With 
 
 Next 
 
 
 
 ' Display a dialog box containing the concatenated 
 
 ' sort field information. 
 
 MsgBox strOutput 
 
 End If 
 
End Sub 
 

属性

名称
Application
类
IsDescending
Parent
Session
ViewXMLSchemaName

另请参阅

Outlook 对象模型引用

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。