PDA

View Full Version : Outlook Rules Custom Action



beri101
09-29-2009, 08:12 AM
Bs"d
Hi everyone
I want to add new rule in outlook with custom action.
I get massage from my site when get new order, and I want to send automatic replay. The problem is, that the email address of the customer is in the body of the Content so I can not respond to sender address because it from my webmaster address.
I want to add new custom action that find the email address that Is between two words, and send to this automatic replay with template.
Can anyone help me please?

All the best,
Beri

JP2112
10-01-2009, 08:50 AM
You won't be able to create a rule that extracts the email address from the body. You'll need to write VBA programming code that extracts the email, creates a reply from a template and sends it.

The code will need to be in an event handler so that it runs automatically. For sample code see http://www.codeforexcelandoutlook.com/outlook-vba/stock-event-code/.

To extract the email address, you can use Regular Expressions to search the body for the email, or the Mid and Instr functions if the address is always between the same two words in every email.

To create a reply from a template, see the CreateItemFromTemplate Method (http://msdn.microsoft.com/en-us/library/aa220081(office.11).aspx).

--JP