redemption MAPIUtils

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
 
K

Ken Slovak - [MVP - Outlook]

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

wlan

Thanks Ken.

I'm calling messageItem.Save. But I'm not clear about 'alert outlook' part.
 
K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top