Leon Zhou
Leon Zhou

Reputation: 635

Redemption mail object not properly linked to original mail item when using GetRDOObjectFromOutlookObject

I have run into this case that if I have obtained a MailItem from OOM and this email is a newly created one, it's entry ID would be null. If I use the RDOSession.GetRDOObjectFromOutlookObject method to get an RDOMail from this MailItem, the obtained RDOMail would have all of properties either null or set to their default value and changing them won't change the value for the corresponding properties in the original MailItem.

Using the same method to get RDOMail from an existing MailItem (one that has a valid entry ID) works fine.

This behaviour is not documented in the Redemption documentation. Just wondering if I'm missing anything here?

Upvotes: 3

Views: 413

Answers (1)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66341

This is something that Outlook Object Model always did (or rather did not do) - until the item is saved, the latest changes set through the UI or the Outlook Object Model are inaccessible through MAPI.

The primary purpose of GetRDOObjectFromOutlookObject is not to facilitate access to the unsaved changes, but rather to ensure that both Redemption and OOM end up working with the same IMessage object retrieved from MailItem.MAPIOBJECT to avoid opening the same IMessage object twice (which can cause conflicts when saving).

Upvotes: 4

Related Questions