View Single Post
  #5  
Old April 7th 06, 09:38 PM posted to microsoft.public.outlook.program_vba
Trey Shaffer
external usenet poster
 
Posts: 6
Default "Run a script" rule triggers but script does not execute

Perhaps I should have said, "Install it on the two workstations that will
use it."


"Sue Mosher [MVP-Outlook]" wrote in message
...
Deploy it? You realize that Outlook VBA code was never designed to be
deployed to other people, right?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Trey Shaffer" wrote in message
...
Yes, Macro Security setting was "High." Changed to "Low" and code ran...
I'm guessing I can use the SelfCert.exe to put a signature on this when
I'm
ready to deploy it...

Thanks Sue

"Sue Mosher [MVP-Outlook]" wrote in message
...
Does other VBA code run? What is your setting in Tools | Macro Security?



"Trey Shaffer" wrote in message
...
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







Ads
 

Web Advertising - Loans - Loans - Mobile Phone - CreditCards