![]() |
|
#1
|
|||
|
|||
|
Hi Everyone,
I have a rule, called autoforward email, which I use remotely on a few occasions. The problem is that I never remember to turn the rule off after I am done with it. Is it possible to write a macro which enables the moment I start outlook? I wanted it to look to see if the rule is on, and, if the rule is on, then disable the rule. I am looking to have the validation occur every time I first start Outlook. I am using Outlook 2007. Thanks in advance! |
|
#2
|
|||
|
|||
|
Why don't you just create a calendar entry, every morning, to prompt you to turn it off? You're over looking this... KISS (Keep It Simple Stupid).
P.s. no offence with the 'Stupid' - it's part of the saying
|
|
#3
|
|||
|
|||
|
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 |