newmailex - messageclass change not displayed message opened

  • Thread starter Thread starter spareway
  • Start date Start date
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
 
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
 
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
 
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
 
Back
Top