Compartir a través de


IPOutlookItemCollection::Sort (Windows CE 5.0)

Send Feedback

This method sorts folder items based on an item property.

HRESULT Sort(BSTR pwszProperty,VARIANT_BOOLfDescending);

Parameters

  • pwszProperty
    [in] Pointer to a null-terminated Unicode string with the property on which to sort.
  • fDescending
    [in] TRUE to sort in descending order, FALSE to sort in ascending order.

Return Values

S_OK indicates success. If an error occurs, the appropriate HRESULT is returned.

Remarks

The default property used to order an Items collection depends not only on the data type, but on the Windows CE-based platform or version as well. If you require a particular sort order, specify it with the Sort method. Do not rely on the default sort order.

You cannot sort on the following properties: Categories, BodyInk, ReminderTime, and Recipients.

Example

The following code shows how to sort items in ascending order.

void SortItems (IPOutlookApp *polApp)
{
  IPOutlookItemCollection *pItems;
  IFolder *pFolder;

  // Get the contacts Items collection
  polApp->GetDefaultFolder (olFolderContacts, &pFolder);
  pFolder->get_Items (&pItems);

  // Sort items
  pItems->Sort (TEXT "[TimezoneIndex]", FALSE);

  // Release objects
  pItems->Release ();
  pFolder->Release ();
}

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Pimstore.h.
Link Library: Pimstore.lib.

See Also

IPOutlookItemCollection | IPOutlookItemCollection Properties

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.