Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook Rules & Scripts.

Status
Not open for further replies.

brigmar

Programmer
Mar 21, 2006
414
0
16
US
I have Outlook 2003, and I'm trying to set up a script to deal with messages from a particular cellphone.
I have set up a rule that can identify and flag those messages, which was easy enough. The next step is to run a script based off of that message, which seemed easy enough:

Tools -> Macro -> Visual Basic Editor
Project1
-- Microsoft Office Outlook Objects
----- ThisOutlookSession

Code:
Sub MyCustomAutomationRule( Item as Outlook.MailItem )
   MsgBox "Test"
End Sub
(Obviously I would interact with the Item object for the real thing.)

Save and Compile Project1.

I go back to the Rule Editor and add "run a script" to the rule. Select "Project1.ThisOutlookSession.MyCustomAutomationRule", and run the rule on a message I have in my Inbox.

Now the rule runs, flags the message as before, and then gives me an error dialog: "The operation failed".

I try to set a breakpoint in the Visual Basic Editor, but nothing happens.

In the end, here's what I want to do:
* Identify messages from cellphone X (can do)
* Extract and Parse the body of the message (this problem)
* Pass the parsed message to a command line app which will do "the intelligent stuff"

Am I even on the right track ? There is of course the ability to "start an application" in the rules editor but that doesn't allow me to pass the body of the message as a parameter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top