IMAPITable::QueryRows sometimes fails to retrieve values of custom properties

  • Thread starter Thread starter Jan Reher
  • Start date Start date
J

Jan Reher

Greetings,

Context: Using MAPI, I want to look at certain properties of all messages in
an inbox. Instead of opening an IMessage interface on all of the messages,
which will fetch all properties including a possibly large body and a number
of possibly large attachments, I fetch the contents table for the folder,
and then use IMAPITable::SetColumns to indicate just the properties I need.
Finally I call IMAPITable::QueryRows to retrieve the actual values of the
properties.

Problem: Sometimes, only sometimes, the IMAPITable::QueryRows call returns
SRow data where the value of some of the properties is MAPI_NOT_FOUND for
messages that I know have these properties. These properties are custom
properties. I have never seen the problem occur for standard Outlook
properties.

Ideas and suggestions are much appreciated.



Best regards,

Jan Reher
 
Are you *sure* you look at the right messages? Do you see the correct
properties in OutlookSpy - click IMAPIFolder, go to the GetContentsTable
tab, add the property in question (SetColumns button) if the property is
not yet listed.
MAPI_NOT_FOUND is sometimes returned if you request multiple version of the
same property - e.g. if you request PR_HTML when PR_BODY and/or
PR_RTF_COMPRESSED is also requested.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Hi Dmitry,

Thank you for the speedy answer. I will investigate, and post back as soon
as I have something to say.


Regards,
Jan Reher

PS: Your presence in the vicinity of Outlook and MAPI is of immense value to
people like me who make extension programs to Outlook for a living.

-----------------------------------------------------
 
Answers to Dmitry's questions:Yes, we are definitely looking at the right message, and we see the expected
properties and values in OutlookSpy.
We do not request such properties.

So, once again, thanky you. We have decided to open the complete IMessage
interface instead of using IMAPITable::QueryRows, since the perceived
performance loss is not significant. So unless someone happens to have a
bright idea readily available, I think we should terminate this thread.



Regards,
Jan Reher
 
Back
Top