Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Outlook Inbox-icons envelope icons

following this link - change outlook MailItem icon

I managed to change my inbox icons.

Here's what I did step by step. 1) Created a custom message class for new mail that arrives from the Internet The class is IPM.Note.Internet

Outlook.NameSpace outlookNameSpace;
Outlook.MAPIFolder inbox;
Outlook.Items items;

    private void ThisAddIn_Startup(object sender, System.EventArgs e)
    {
        outlookNameSpace = this.Application.GetNamespace("MAPI");
        inbox = outlookNameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);

        items = inbox.Items;

        items.ItemAdd += new Outlook.ItemsEvents_ItemAddEventHandler(items_ItemAdd);
    }

    void items_ItemAdd(object Item)
    { 
        Outlook.MailItem mailitem = (Outlook.MailItem)Item;
        String EmailHeader = mailitem.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x007D001E");
        if (Item != null && EmailHeader.Contains("Look for a string in the headers here that we set for incomming mail") == true)
        {
            if (mailitem.MessageClass == "IPM.Note")
            {
                mailitem.MessageClass = "IPM.Note.Internet";
                mailitem.Save();
            }
        }
    }

2) Created a replacement Outlook Form Region matching the MessageClass. In this case I used IPM.Note.Internet

3) Assign the Icons in the Properties Pane of the Form Region Designer. enter image description here

4) Debugged project and the next message that arrived from the internet was stamped with my custom icons after the message class was updated.

My issue now is that I can't preview or open the messages where I changed the message class. Similar to this post that's unanswered - Change Inbox-icons in Outlook at runtime

I think the issue is that my replacement Outlook Form Region is blank so the message is not able to be previewed.

If this is true than here's my question. What is the best way to export the standard IPM.Note message class template into visual Studio. I thing I need to overwrite my IPM.Note.Internet Outlook Form Region design.

There is an option when creating an Outlook Form Region- enter image description here

To import an ".OFS" file. I was attempting to figure out how to export the file from the Outlook 2010 Client (Developer Tools) but I can't find a way to save the templates to that specific format. I can save to OFT (office template) but not .OFS

Thanks in advance for any help!

like image 759
Kevin Moore Avatar asked Dec 09 '25 07:12

Kevin Moore


1 Answers

Rather then adding a form region and changing the message class I just ended up adding the PR_ICON_INDEX property and setting it's value. As outlined here in option #2 by Dmitry Link

There are many icons to choose from here. I couldn't locate a list with the integer values so I just entered random numbers for the PR_ICON_INDEX property in Outlook Spy changing the value till located the icon I wanted. There are many icons to choose from. Many from the 600-700 and 1000 and up range.

Here's the line I used to set the PR_ICON_INDEX property on the message-

mailitem.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/proptag/0x10800003", 4); // change the 4 to something like 600,601...etc to experiment 
like image 115
Kevin Moore Avatar answered Dec 10 '25 22:12

Kevin Moore



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!