After calling SortTable, PR_SUBJECT, IMAPITable (Exchange Server, Folder, contents) is unstable.

Feb 11, 2011 at 4:28 PM


Office Outlook (2000-2010)
Connection - No Cache
OS - XP/VISTA/Windows 7
Exchange Server (5.5 - 2010)

After calling SortTable, with sort criteria PR_SUBJECT, IMAPITable (Exchange Server Private Store, Folder, contents) is unstable.

Any subsequent call to IMAPITable methods returns an error.
QueryRows returns S_OK, but LPSRowSet.cRows is 0.

If store is local (PST), everthing is OK. Also everthing is OK (Exchange Server Private Store) , if we uses other property for sorting as PR_SENDER_NAME, PR_MESSAGE_DELIVERY_TIME, PR_MESSAGE_SIZE, etc..

Feb 11, 2011 at 4:59 PM

This issue reproduces with every version of Oultook and every version of Exchange, ever? Kinda hard to believe. I assume you can reproduce this in MFCMAPI? Can you share repro steps? Also, what errors are you getting?

Feb 11, 2011 at 6:40 PM
Edited Feb 11, 2011 at 6:49 PM

yes.  every version of Oultook (from 2000 to 2010) and every version of Exchange (currently tested with 5.5, 2003, 2010).

1. Open Exchange Inbox or any other folder (Exchange)
2. Menu -> Table -> Sort Table
3. cSorts, total number of sort orders = 1, others = 0
4. Property Tag = PR_SUBJECT
5. Sort Order -> ASC
6. Press OK
Code: MAPI_E_NO_SUPPORT == 0x80040102
Function lpContentsTable->GetRowCount( NULL, &ulTotal)
File .\ContentsTableListCtrl.cpp
Line 646



Feb 11, 2011 at 7:07 PM

Perhaps this is because PR_SUBJECT is actually computed. Try using PR_NORMALIZED_SUBJECT.

Feb 11, 2011 at 7:22 PM

Thank you very much for your response.
Jump I was mad, I thought, that  I already see the white mice and skeletons, as this is not noted in any HELP available for Extended MAPI (from 1996 to now). So for Exchange Server, the rule is, that tables can not be sorted by computed properties, but this does not apply to PST?
With PR_NORMALIZED_SUBJECT everything is OK.
Thank you!


Feb 11, 2011 at 7:36 PM

Well - different store providers have different capabilities. Apparently, the PST provider is fine with sorting by PR_SUBJECT, while Exchange prefers you use the the normalized subject. BTW, both properties and their relation is discussed in the MSDN:

Feb 11, 2011 at 7:51 PM

Once again - thank you for your help and sorry if I bore you with my investigations and tests :)