![]() |
|
|
|
#1
|
|||
|
|||
|
http://www.outlookcode.com/threads.a...essageid=28707
As indicated in the link above, for Outlook 2007 and subsequent. Code goes in the "ThisOutlookSession" module. To turn the rule off at startup. Code:
Private Sub Application_Startup()
Dim olRules As Outlook.Rules
Dim olRule As Outlook.Rule
Set olRules = Application.Session.DefaultStore.GetRules
Set olRule = olRules.Item("Rule Name")
olRule.Enabled = False
olRules.Save
Set olRules = Nothing
Set olRule = Nothing
End Sub
Code:
Private Sub Application_quit()
Dim olRules As Outlook.Rules
Dim olRule As Outlook.Rule
Set olRules = Application.Session.DefaultStore.GetRules
Set olRule = olRules.Item("Rule Name")
olRule.Enabled = True
olRules.Save
Set olRules = Nothing
Set olRule = Nothing
End Sub
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Out Of Office Rule Not Selected | DrDOS | Outlook | 0 | 11-27-2011 02:30 PM |
| 1 Calendar to rule them all... | halcyoneus | Outlook | 0 | 11-18-2011 02:57 PM |
| Rule to reply | GeeksBsmrT | Outlook | 0 | 08-25-2010 07:08 AM |
Facebook rule?
|
markg2 | Outlook | 3 | 08-06-2010 05:17 AM |
| Rule runs once, but not later | stlsailor | Outlook | 0 | 07-28-2009 08:18 PM |