(Also posted this in the "Office" forum, but the error seems to be with the VBA section, so here goes...)
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
(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, hence trying to write a VBA script to do that work.
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
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, hence trying to write a VBA script to do that work.