This documentation is archived and is not being maintained.


This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Sets the default sort order for a folder's contents table.

HRESULT SaveContentsSort(
  LPSSortOrderSet lpSortCriteria,
  ULONG ulFlags


[in] A pointer to an SSortOrderSet structure that contains the default sort order.


[in] A bitmask of flags that controls how the default sort order is set. The following flag can be set:


The default sort order set applies to the indicated folder and to all its subfolders.


The sort order was successfully saved.


The message store provider does not support saving a sort order for its folder contents tables.

The IMAPIFolder::SaveContentsSort method establishes a default sort order for a folder's contents table. That is, when a client calls the folder's IMAPIContainer::GetContentsTable method after the code calls SaveContentsSort, the rows in the returned contents table will appear in the order established by SaveContentsSort.

Not all message store providers support SaveContentsSort; it is acceptable for message store providers to return MAPI_E_NO_SUPPORT from the SaveContentsSort method.