Platform SDK: CDO 1.2.1 |
The Sort method sorts the collection on the specified property according to the specified sort order.
objFoldersColl.Sort( [SortOrder] [, PropTag] )
objFoldersColl.Sort( [SortOrder] [, name] )
Value | Numeric value | Description |
---|---|---|
CdoNone | 0 | No sort |
CdoAscending | 1 | Ascending sort (default) |
CdoDescending | 2 | Descending sort |
Both parameters are optional. If SortOrder is not specified, ascending order is used. If neither PropTag nor name is specified, the property used in the previous call to Sort is used again. If Sort has never been called on this collection during this session, the MAPI property CdoPR_DISPLAY_NAME is used for the sort.
Each call to Sort generates an entirely new sort order based on the specified property. No previous sort order is retained or nested.
If the underlying messaging system does not support the sort criteria specified, for example descending order or MAPI named properties, the Sort method returns CdoE_TOO_COMPLEX.