I'm developing an outlook 2010 addin that exports the emails to a specific locations when an user clicks a button from the menu.
This part is not a problem, but I need also to change the MailItem
icon-pictogram if the export was successful. I tried to look for solutions, but I only get that I need to use form regions , but I didn't find a true helpful solution.
Any ideas how should I use this form regions?!
I finished the add-in and everything seems to work perfect when debugging from VS 2010. I also created an installer, but after installing the application the Outlook won't display my icons like I want. Instead of showing what you can see above, it changes the icons, but shows a default one - not mine. The icons are in the resx file from the FormRegion that I used (I use dor default and read icons from manifest) , I also tried to move them to the general Resource file (Properties.Resource), but the result is the same. Can someone help me with this?
So I added a FormRegion using Replacement and ReplaceAll also, added my icon on default icon on manifest, and name it IPM.Note.MyExportedItem.
In the 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 is not changing the mailItem (email message) icon from Inbox for example to my icon when I export them like I want, the only change that I can see is when I call Display(true) and it opens the mail message. Also if I press New Items, Choose Form and I open my Form Region, it opens a compose message window and if I send an email to me, then it will have my icon...strange...you can see in the picture :-) Do you have any idea what I am doing wrong?
Regards
Click on the "Tools" menu in Outlook and select "Options." Under Preferences, click "Email Options," then "Advanced Email Options." Check "Show an envelope icon in the notification area" to restore the icon.
File-> Options-> section Mail-> option group: Message arrival-> option: Show an envelope icon in the taskbar.
MailItem.MessageClass
(IPM.Note.MyCompany.MyExportedItem) to your exported items.MessageClass
This MSDN forum post also describes the process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With