3

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?

Leon Zhou
  • 633
  • 6
  • 20

1 Answers1

4

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).

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • 2
    Thanks for the confirmation. It would be a good idea to add this to the documentation so the other developers can watch out for this behaviour. – Leon Zhou Feb 02 '17 at 03:54