![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I am attempting to use the "Run a script" action in an Outlook 2003 rule.
The script contents appears to be valid, with the requisite MailItem. The subroutines are recognized, and selectable, in the Rules Wizard. Code below... The rule is being triggered. If I add some other built in action action, Play a Sound, etc., to the rule, it occurs. Following are two code bits. The first is from Sue Mosher. The second is just a minimalist fragment to produce a visible result, the MsgBox. Niether one produces the expected message box. Fragment 1 _________________________________________ Sub RunAScriptRuleRoutine(MyMail As MailItem) Dim strID As String Dim olNS As Outlook.NameSpace Dim olMail As Outlook.MailItem strID = MyMail.EntryID Set olNS = Application.GetNamespace("MAPI") Set olMail = olNS.GetItemFromID(strID) ' do stuff with olMail, e.g. MsgBox olMail.Body Set olMail = Nothing Set olNS = Nothing End Sub Fragment 2 __________________________________________ Sub Test(objMyMail As MailItem) MsgBox "Hello World" End Sub Your help appreciated... -- Trey Shaffer |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem running a VBA script from an Outlook rule | Olivier Langlois | Outlook and VBA | 5 | March 16th 06 09:03 PM |
Problem running a VBA script from an Outlook rule | Olivier Langlois | Add-ins for Outlook | 5 | March 16th 06 09:03 PM |
"Outlook requires Window Installer to run" | Leo Kerner | Outlook - General Queries | 0 | March 16th 06 07:52 PM |
Create rule by script | Louis | Outlook and VBA | 3 | March 15th 06 04:49 PM |
Script in Rule | clarkel | Outlook and VBA | 2 | February 2nd 06 08:20 PM |