_Items.Sort(String, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sorts the collection of items by the specified property. The index for the collection is reset to 1 upon completion of this method.
public void Sort (string Property, object Descending);
Public Sub Sort (Property As String, Optional Descending As Object)
Parameters
- Property
- String
The name of the property by which to sort, which may be enclosed in brackets, for example, "[CompanyName]". User-defined properties that contain spaces must be enclosed in brackets. May not be a user-defined property of type keywords, and may not be a multi-valued property, such as a category. For user-defined properties, the property must exist in the UserDefinedProperties collection for Parent, which represents the Folder object that contains the items.
- Descending
- Object
True to sort in descending order. The default value is False (ascending).
Remarks
Sort only affects the order of items in a collection. It does not affect the order of items in an explorer view.
Sort cannot be used and will cause an error if the property
parameter is one of the following properties: