Creating UserProperties using MAPI

  • Thread starter Thread starter Navin
  • Start date Start date
N

Navin

hi All,
I am creating a named user property using the IMAPIProp interface but
when I try to access the property via the Outlook object model
(Outlook::UserProperties) the property does not show up. Any clues why
this may be so and what could be the known workarounds?
Thanks
Navin.
 
I noticed (with the help of OutlookSpy) that there exists a MAPI
property called UserProperties on the outlook item, which is of type
PT_BINARY and seems to contain a list of all user properties defined
for the item. Any clue how we can manipulate the property via MAPI
interfaces?
Deleting the property does not seem to regenerate it.
Thanks
Navin.
 
The format of that property is not documented of course and I am not aware
of any public code samples that can parse it..

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Actually the article talks about the Outlook Object Model properties that
are stored as Extended MAPI named properties (such as
ContactItem.Email1Address). These properties can be accessed using Extended
MAPI juts fine, it is just MS does not support that.
UserProperties collection is different - besides being stored as the named
properties (which can be set/read using Extended MAPI), OOM uses a binary
prop (which is a named prop itself) to store the format and other
housekeeping information about the UserProperties collection.
Reading the UserProperties entries is easy, it is setting them is hard since
you'd need to update that blob.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
I've had a similar problem. I don't know about your particular case but in
my case the real problem was that my custom properties that I was adding to
an item didn't bind into custom form's fields. The way I solved that problem
(unfortunately) was pretty straight forward: I just copied my custom
properties into UserProperties list on item's Open event. This caused
another problem to rise. For data/time type of properties Outlook does UNC
conversion on get/put to UserProperties (unlile MAPI). It's a big pain to
keep those two (MAPI and UserProperties) in sync. So, unless your design
prohibits that, use UserProperties for your custom props. Just to move
things a bit forward, dealing with attachments on MAPI and sync'ing them
with Attachments is even more hell! So, try to stick (as much as you can) to
Outlook API :-)
 
Back
Top