View Single Post
  #2  
Old March 21st 08, 06:46 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default incoming message rule to kick off vba with a variable

A rule can call a "script", which is a specially formatted Public Sub in the
Outlook VBA project. For mail items the Sub would look like this:

Public Sub whateverNameYouWant(Item As Outlook.MailItem)
' blah, blah
End Sub

That would let you access the Subject and call to other macros.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


wrote in message
...
I'm new to programming VBA for Oulook but not Access, but here's what
I am trying to do:

I do business with about 25 branches of a particular company.
The branches are identified like this: ABC01, ABC03, ABC23, ABC58,
etc, all 5 digits.

I 'd like to send a message to my "Worker machine" (a box that runs
Access and Outlook) that says in the subject "SendTo ABC03" and it
would start an application (access) with a macro named ABC03 which
would pull the recordset and e-mail the report. I have the back half
of that already done.
What I need is a way to pass the ABC03 from the subject line into the
start application variable to call the proper macro.

I could do this with 25 rules, but I thought there might be an easier
way to do it using VBA.


Ads