none
Outlook 2010, detect folder click OR run macro when email is received in specific inbox RRS feed

  • Question

  • Anyone know how to detect if a certain folder was clicked in Outlook 2010? I have a macro I've written that loops through a bunch of pre-built rules and moves emails from a centralized inbox to 1 of 100 different subfolders depending on what's in the subject. I'd like to run this macro when a user clicks a certain folder, rather than forcing them to press a button on their toolbar. Any suggestions?

    EDIT: it would also be acceptable (preferable actually) to just run my macro when a new email arrives in a designated inbox. I have a shared inbox we'll call ABC. I know I can use the application_NewMail event to fire code when I receive an email in MY inbox, but how can I target this shared ABC inbox to do that?

    Tuesday, April 22, 2014 6:56 PM

Answers

  • Hello,

    > Anyone know how to detect if a certain folder was clicked in Outlook 2010?

    The Outlook object model provides only the FolderChange and BeforeFolderSwitch / FolderSwitch events. So, if you click on a different folder, you will get these events fired. But you will not find any Click-related events.

    You can handle the NewMailEx event or just use the ItemAdd event of the Items class of a particular folder. It occurs when one or more items are added to the specified collection.
    Be aware, the ItemAdd event does not run when a large number of items are added to the
    folder at once (more than 16).


    Tuesday, April 22, 2014 7:14 PM