redemption MAPIUtils

  • Thread starter Thread starter WLAN
  • Start date Start date
W

WLAN

Hi,

I'm setting some custom properties using Redemption.MAPIUtils interface.
MessageItem interface is accessed from MAPIUtils and each property is set to
the mail message using HrSetOneProp() function.

The problem is that these properties are not available now. i need to
restart outlook for getting these values. I have checked the same using
Outlook Spy and it didn't show those properties. Once I restart outlook, it
shows all properties.

What is the issue? How do I resolve it?

I need to read those properties after setting it.

Thanks
 
I assume you saving the MessageItem?

You probably also need to alert Outlook that the item underlying the
MessageItem has changed. Usually we use a trick like this, where item would
be the item underlying the MessageItem object:

item.Subject = item.Subject
item.Save

That should be done after saving the MessageItem and releasing references to
it.
 
Outlook doesn't know about changes made to items using Extended MAPI, for
which Redemption is a wrapper (more or less). So until it's restarted or an
object is unloaded and re-loaded it doesn't know about changes you made.

That little hack of setting Subject equal to itself on the original Outlook
item and then saving that forces Outlook to re-read the MAPI properties and
become aware of your changes using Redemption.
 
Back
Top