views:

532

answers:

1

I would like VBA code for Outlook 2007 to right-click a message in any mail view, choose a rule to add it to, and have the sender email be added to the Message Header contains value for that rule.

Only particular rules use Message Header as a criteria, so only those applicable rules should show when I right-click a message.

+1  A: 

With a little effort, you are able to manipulate the context menu with VBA.

Any Outlook version prior to 2007 has no object model for rules.

But since OL2007, each Store object exposes GetRules() method, which returns a Rules collection. Try to iterate that collection and fill a CommandBarPopup object with all the rules you want. The Rule objects can be manipulated, so in theory you should be able to do the job.

Tomalak