MailItem appearance change icon

I am developing an Outlook 2010 addin that exports emails to specific locations when a user clicks a button on a menu.

This part is not a problem, but I also need to change the icon of the MailItem icon if the export was successful. I tried to find solutions, but I realized that I needed to use form areas , but I did not find a true useful solution.

Any ideas how to use these form areas ?!


I finished the add-in and everything seems to work fine when debugging with VS 2010. I also created an installer, but after installing the application Outlook will not display my icons as I want. Instead of showing what you see above, it changes the icons, but shows the default value - not mine. The icons are in the resx file from FormRegion, which I used (I use dor default and read the icons from the manifest), I also tried to transfer them to the shared resource file (Properties.Resource), but the result is the same. Can someone help me with this?


So, I added FormRegion using Replace and ReplaceAll, adding an icon to the default icon in the manifest and name it IPM.Note.MyExportedItem.

In thisAddin.cs, I have the following code:

MailItem mailItem = (selectedItem as MailItem);

  itemGuid = mailItem.EntryID; string name = mailItem.Subject + ".msg"; name = "C:\\" + name.Replace(":", ""); try { mailItem.SaveAs(name, OlSaveAsType.olMSG); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } mailItem.MessageClass = "IPM.Note.MyExportedItem"; mailItem.Display(true); ........ 

But this does not change the mailItem icon (email message) from the Inbox, for example, to my icon, when I export them as I want, the only change I see is when I call Display (true) and open the mail message. Also, if I click "New Elements", "Select a Form" and I open my region of the form, it will open a message box and if I send an email to me, then it will have my icon ... strange ... you can you see in the picture :-) Do you have any idea what I'm doing wrong?

This is how it looks

Hi

+6
source share
1 answer

Here are the steps required to use custom icons in Outlook:

This MSDN forum post also describes the process .

+8
source

Source: https://habr.com/ru/post/918539/


All Articles