See this KB article on how to wire up a macro to a rule:
How to create a script for the Rules Wizard in Outlook:
http://www.**--****.com/ ;en-us;q306108
Aside from that, all the database plumbing is up to you. The event that you
wire above gives you the MailItem object so you have access to its
properties. For more resources on database integration with Outlook, see
this page:
Connecting Outlook and Exchange to Databases:
http://www.**--****.com/
--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.**--****.com/
Blog: http://www.**--****.com/