Outlook) (OrderField 物件

代表用於排序檢視中之資訊的順序欄位。

註解

使用 OrderFields 物件的 Add 方法,針對從 View 物件衍生的下列物件,將 Outlook 項目屬性新增至 SortFields 集合:

使用 ViewXMLSchemaName 屬性來取得訂單欄位的名稱,如檢視表的 XML 定義中所參考。

包含在 OrderFields 集合中的 OrderField 物件會依照物件包含在集合中的順序,套用至檢視中顯示的 Outlook 項目。 對每個 OrderField 物件使用 IsDescending 屬性,可以決定要以遞增還是遞減的順序,排序順序欄位的內容。

範例

下列 VBA) (Visual Basic for Applications 範例會逐一查看目前 TableView 物件的 SortFields 集合,顯示集合中每個 OrderField 物件的標籤與 XML 結構描述名稱。

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
Class
IsDescending
Parent
Session
ViewXMLSchemaName

另請參閱

Outlook 物件模型參考

支援和意見反應

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