OpenProperty for IMapiPropertyAccessor? Need to get attached Outlook message.

Add-in Express™ Support Service
That's what is more important than anything else

OpenProperty for IMapiPropertyAccessor? Need to get attached Outlook message.
 
Jason Swager




Posts: 14
Joined: 2010-04-29
The MAPIStoreAccessor works great for getting normal MAPI property values for various MAPI types. But one thing it seems to be lacking is an equivalent to IMAPIProp.OpenProperty() on the IMapiPropertyAccessor interface.

In my situation, I'm trying to get an attachment off an Outlook message, where the attachment is an imbedded object that supports IMessage. I've tried using AddinExpress.MAPI.Attachment class to get the particular object using the _PR_ATTACH_DATA_OBJ tag, but only a NULL is returned. All samples I've seen use the OpenProperty() method.

Normally, the IMAPIProp interface off the Outlook objects would work fine. But we've found that when the message is in an Exchange account and the Exchange account has Cache Mode disabled, the IMAPIProp interfaces don't always return all values all the time. But if we drop down into MAPI - via th MAPIStoreAccessor - we can reliably get the property values.

Except for this PR_ATTACH_DATA_OBJ value.

Any solutions?
Posted 21 Oct, 2010 17:37:24 Top
Eugene Astafiev


Guest


Hi Jason,

1. The GetProperty function of the AddinExpress.MAPI.Attachment class uses the OpenProperty method of the IMAPIProp interface.
2. The Attachment class in Outlook provides you with the Type property. Depending on the value of that property you may get null. What value do you have in case you get null?

Does the MAPI Store Accessor work for you properly?
Posted 26 Oct, 2010 11:55:02 Top
Jason Swager




Posts: 14
Joined: 2010-04-29
The MAPI Store Accessor object wasn't working as expected in regards to the PR_ATTACH_DATA_OBJECT property when used with Exchange cached mode DISABLED. When cached mode was ENABLED, the Accessor would give me the property values correctly.

There is a chance that this was due to our code misusing the attachments and properties. See http://msdn.microsoft.com/en-us/library/cc842318.aspx, in particular, a reference to opening an attachment only once.

For the moment, we're working around the problem using C++ Extended MAPI code. If time allows, I'm going to attempt to convert back to the MAPI accessor.
Posted 26 Oct, 2010 13:42:38 Top
Eugene Astafiev


Guest


Hi Jason,

I will test that issue on my PC and let you know the results.
Posted 29 Oct, 2010 12:46:12 Top