0

I’ve about 8 different set of email id groups, which are assigned a particular category in my outlook client. All email id’s exists in a table in a SQL server database instance and can be fetched according to categories they belong to.

Now I wish to mark an incoming mail to a category and auto forward that mail to the email id’s fetched using a script from the database.

First question - is it possible to write a script and attach it to a rule?

Second question - Is it necessary to have a outlook client always on to keep this system alive? I mean will this script based rule system work as a server rule or just a client rule?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
kaushal
  • 107
  • 5

1 Answers1

1

You can attach a VBA macro to a mail rule. It looks as follows:

Sub MyMessageRule(newMail As Outlook.mailItem)
....
End Sub

It would be possible to use a SQL server DB connection in this macro.

It is also possible to use server-side scripting. But that requires access rights and more skills.

Axel Kemper
  • 10,544
  • 2
  • 31
  • 54
  • Thanks, how can i call a web service in this script if I am not directly connecting to SQL server DB? Pardon my ignorance of the VBA macro. – kaushal Feb 14 '13 at 16:04
  • This depends on your Outlook version. Look at related questions in StackOverflow: http://stackoverflow.com/questions/3521876/calling-web-service-using-vba-code-in-excel-2010 – Axel Kemper Feb 14 '13 at 16:45