Question

I am using Redemption to create some UserProperties on a list of Email Objects, and I have these four lines in an Outlook 2013 Add-In:

RDOMail rdoMail = Globals.ThisAddIn.session.GetMessageFromID(folder.Items[1].EntryID);
RDOUserProperty rdoUP = rdoMail.UserProperties.Add("PropertyName", rdoUserPropertyType.olText, Type.Missing, Type.Missing);
rdoUP.Value = "value";
rdoMail.Save();

But there are no UserProperties created.

Anybody knows why?

Was it helpful?

Solution

Outlook cannot see changes made with MAPI - you will have the same problem even if you do not use Redemption: if you connect to the same Exchange mailbox from two machines, changes made on one machine will not be visible on another machine until the item in question is completely dereferenced and reopened.

The rule of thumb is to either avoid opening the item using OOM or (if you absolutely have to) release it as soon as you are done using Marshal.ReleaseComObject. You also need to be careful to avoid multiple dot notation to make sure no implicit variables (which you cannot reference) are create by the compiler.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top