Sicos1977 / MSGReader

C# Outlook MSG file reader without the need for Outlook
http://sicos1977.github.io/MSGReader
MIT License
475 stars 168 forks source link

Accessing properties that don't have consistent proptag #372

Closed matt1liu closed 10 months ago

matt1liu commented 11 months ago

Hello, I would like to use MSGReader to add reactions data to the body when an .msg is extracted to html. I am trying to add code to retrieve the MAPI property that reactions depends on, but this property does not have a consistent proptag, and may change per-mailbox. Here's an example I've retrieved from MFCMapi. image I see there is similar code to retrieve Keywords/Categories, but I did not have luck following the same pattern. Are these MAPI properties able to be retrieved by Storage.GetMapiProperty? Is there way of getting these properties from name and namedPropertyGuid? Thanks!

Sicos1977 commented 11 months ago

This are so called named properties. They always have an address that is above 0x8000. Everything below is static. But named properties should always have the same name no matter wat address they get. So you can use the name to get them.

matt1liu commented 11 months ago

I see that GetMapiPropertyFromPropertyStream and GetMapiPropertyFromPropertyStreamOrStorage compare the propertyIdentifer the caller passes (ReactionsSummary in my case) to MAPI properties from the stream, but I only see comparison of property address (x8xxx), and no comparison of property name. I set up a test and can verify from a break point that the property does exist in the stream, but in the end, the property identifier ReactionsSummary is not "found".

image image

Please let me know if im missing something or can provide extra information. thanks so much!