Advice on MAPIProp usage

  • Thread starter Thread starter Vladimir Chtchetkine
  • Start date Start date
V

Vladimir Chtchetkine

I would like to use MAPIProp of MAPIFolder to store some custom properties
in place, directly with the folder I'm using. This simplifies the design a
lot and seems very neat. But there are some Qs. First of all, are there any
conventions on using PropertyID? What are the rules in picking them up for a
custom use? And secondly, are there any limitations on a property size? I'm
thinking about a string property. Quick experiment has shown that MAPIProp
eats 10K string with no problemo, but I still have doubts :-)



TIA,



Vladimir
 
1. To avoid prop tag conflicts, use named properties. Note that Exchange
provider does not support named properties on folders.
2. Exchange will limit the amout of data retrieved in a single call to 32 kB
or so. To avoid the limitation, the property must be opened as IStream
(IMAPIProp::OpenProperty) rather than retrieved using
IMAPIProp::GetProps/HrGetOneProp.
3. The standard way of storing custom properties is to create a hidden
message in the folder with your own custom message class. You will be the
only one using it, so there is no risk of prop tag collision.

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

Makes sense! How do I hide a message? I couldn't find this type of
property/method in neither _MailItem nor _PostItem (the two that I'm using)



TIA,



Vladimir
 
You can't hide a message. All folders in MAPI expose two contents tables:
regular contents and associated (hidden) contents table.
You need to be using Extended MAPI/CDO 1.21/Redemption to access them; OOM
won't do. You also cannot move messages between the two tables by setting a
magic flag.
Look at a folder (Inbox is a good example) with MdbView or OutlookSpy to see
what Outlook usually stores there.

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