newmailex - messageclass change not displayed message opened

S

spareway

Hi,

I have a C# addin that changes the messageclass of the incoming email
message from IPM.Note to IPM.Note.ZZZ. The message class is changed
and the new icon is displayed in the message pane. But when i open the
message it displayed as an IPM.Note. If i restart outlook and open
the message, it is displayed as an IPM.Note.ZZZ.

thanks for any help.

-craig
 
S

Sue Mosher [MVP-Outlook]

Your code needs to release the object used to make the changes, then return the item using a different object variable (HINT: Use Namespace.GetItemFromID) and display that item.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

spareway

sue,

thanks for the response. I am changing the messageclass in the
NewMailEx event and i do release the object by executing:
Marshal.ReleaseComObject(mailItem);

But I still have the same behavior. Any other ideas?

thanks,

craig
 
S

Sue Mosher [MVP-Outlook]

Are you opening it manually or programmatically? If the later are you returning the saved item with Namespace.GetItemFromID after releasing it?

You may need to call GC.Collect to force garbage collection to make sure the item is 100% released.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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