M
MoRs
Hi,
I have a Outlook add-in that adds the the menu item in the menu bar. When
the user selects the menu item, my code is executed and changes the
MessageClass for the selected MailItem.
Now the problem - when the code finishes and I try to open the selected
MailItem the standard outlook mail form is shown. Outlook Spy showns that
the MailItem.MessageClass has the new value, while
MailItem.FormDescription.MessageClass still has the value "IPM.Note".
As I understood the MailItem.FormDescription holds the information about the
form used to display the item. So is there any way to refresh/reload the
MailItem.FormDescription?
I can even replicate this behaviour through Outlook Spy by changing
PR_MESSAGE_CLASS property. Maybe I am researching the wrong way?
There is the code that is executed:
Outlook._MailItem item = null;
item = m_outlookApp.ActiveExplorer().Selection[1] as Outlook._MailItem;
if ( !item.MessageClass.Equals("IPM.Note.NewNETTest") )
{
item.MessageClass = "IPM.Note.NewNETTest";
item.Save();
item.Close(Outlook.OlInspectorClose.olSave);
string entryID = item.EntryID;
item = null;
item =
(Outlook._MailItem)m_outlookApp.GetNamespace("MAPI").GetItemFromID(entryID,
System.Type.Missing);
item.Display(false);
}
I have a Outlook add-in that adds the the menu item in the menu bar. When
the user selects the menu item, my code is executed and changes the
MessageClass for the selected MailItem.
Now the problem - when the code finishes and I try to open the selected
MailItem the standard outlook mail form is shown. Outlook Spy showns that
the MailItem.MessageClass has the new value, while
MailItem.FormDescription.MessageClass still has the value "IPM.Note".
As I understood the MailItem.FormDescription holds the information about the
form used to display the item. So is there any way to refresh/reload the
MailItem.FormDescription?
I can even replicate this behaviour through Outlook Spy by changing
PR_MESSAGE_CLASS property. Maybe I am researching the wrong way?
There is the code that is executed:
Outlook._MailItem item = null;
item = m_outlookApp.ActiveExplorer().Selection[1] as Outlook._MailItem;
if ( !item.MessageClass.Equals("IPM.Note.NewNETTest") )
{
item.MessageClass = "IPM.Note.NewNETTest";
item.Save();
item.Close(Outlook.OlInspectorClose.olSave);
string entryID = item.EntryID;
item = null;
item =
(Outlook._MailItem)m_outlookApp.GetNamespace("MAPI").GetItemFromID(entryID,
System.Type.Missing);
item.Display(false);
}