How to auto remove the original color category when assigning a new category to an outlook item RRS feed

  • Question

  • Hi, I am using Outlook 2010

    I want to know how can i make outlook to auto remove the original color category when I assign a new one to an item, no matter an email, contact, task or appointment, etc. In other words, I would like to limit the number of color category assigned to one item.

    Maybe Outlook doesn't have such a feature. Can vba realize it? Anyone can help me?

    Any help is much appreciated. Thanks a lot!!!


    • Edited by ShirleyZZ Wednesday, March 29, 2017 6:35 AM
    Wednesday, March 29, 2017 6:34 AM

All replies

  • Hello Shirley,

    You can track changes in VBA by handling the PropertyChange event of the MailItem class which  is fired when an explicit built-in property (for example, Subject) of an instance of the parent object is changed. Note, the name of the property that was changed is passed as a parameter. In the event handler you can check out the Categories property which returns a string representing the categories assigned to the Outlook item. Be aware, making changes in the PropertyChange event handler is not a good idea, so be aware of possible issues (can be fired recursively).

    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Wednesday, March 29, 2017 1:01 PM
  • Hi Eugene,

    Thanks for your help.

    But, in the PropertyChange event handler, how can I identify which is the original color category and whcih is the new one?

    My idea is to get the original category and then use code to remove it. :)

    Thursday, March 30, 2017 5:30 AM