OrderField.ViewXMLSchemaName Property (Outlook)

Returns a String value that represents the XML schema name for the property referenced by the OrderField object. Read-only.

Version Added: Outlook 2007

expression .ViewXMLSchemaName

expression A variable that represents an OrderField object.

The value of this property contains the name of the property as it is included within the XML definition of the view containing the ViewField object. This value may not match the name used to refer to the property when the OrderField object was defined.

The following Visual Basic for Applications (VBA) example iterates through the SortFields collection of the current TableView object, displaying the label and XML schema names of each OrderField object in the collection.

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 = _ 
 ' 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 
 ' Display a dialog box containing the concatenated 
 ' sort field information. 
 MsgBox strOutput 
 End If 
End Sub 

© 2014 Microsoft