Ive seen forums discussing rules to enable / disable rules based on time of day and or based on a task trigger using VBA codes, however those only work if teh account is a POP3 accoutn not when its an IMAP account.
Is there any way to get these codes to work on an IMAP account.
----
Sample VBA code on a POP account based on task trigger
Private Sub Application_Reminder(ByVal Item As Object)
If Item.MessageClass <> "IPM.Task" Then
Exit Sub
End If
If Item.Subject = "Enable Rule" Then
Enable_Run_Rule
End If
If Item.Subject = "Disable Rule" Then
Disable_Run_Rule
End If
End Sub
' Macro to enable a rule
Sub Enable_Run_Rule()
Dim olRules As Outlook.Rules
Dim olRule As Outlook.Rule
Dim intCount As Integer
Dim blnExecute As Boolean
Set olRules = Application.Session.DefaultStore.GetRules
Set olRule = olRules.Item(outofoffice)
olRule.Enabled = True
If blnExecute Then olRule.Execute ShowProgress:=True
olRules.Save
Set olRules = Nothing
Set olRule = Nothing
End Sub
' Macro to disable a rule
Sub Disable_Run_Rule()
Dim olRules As Outlook.Rules
Dim olRule As Outlook.Rule
Dim intCount As Integer
Dim blnExecute As Boolean
Set olRules = Application.Session.DefaultStore.GetRules
Set olRule = olRules.Item(outofoffice)
olRule.Enabled = False
If blnExecute Then olRule.Execute ShowProgress:=True
olRules.Save
Set olRules = Nothing
Set olRule = Nothing
End Sub
--
any help is greatly appriciated!!
Is there any way to get these codes to work on an IMAP account.
----
Sample VBA code on a POP account based on task trigger
Private Sub Application_Reminder(ByVal Item As Object)
If Item.MessageClass <> "IPM.Task" Then
Exit Sub
End If
If Item.Subject = "Enable Rule" Then
Enable_Run_Rule
End If
If Item.Subject = "Disable Rule" Then
Disable_Run_Rule
End If
End Sub
' Macro to enable a rule
Sub Enable_Run_Rule()
Dim olRules As Outlook.Rules
Dim olRule As Outlook.Rule
Dim intCount As Integer
Dim blnExecute As Boolean
Set olRules = Application.Session.DefaultStore.GetRules
Set olRule = olRules.Item(outofoffice)
olRule.Enabled = True
If blnExecute Then olRule.Execute ShowProgress:=True
olRules.Save
Set olRules = Nothing
Set olRule = Nothing
End Sub
' Macro to disable a rule
Sub Disable_Run_Rule()
Dim olRules As Outlook.Rules
Dim olRule As Outlook.Rule
Dim intCount As Integer
Dim blnExecute As Boolean
Set olRules = Application.Session.DefaultStore.GetRules
Set olRule = olRules.Item(outofoffice)
olRule.Enabled = False
If blnExecute Then olRule.Execute ShowProgress:=True
olRules.Save
Set olRules = Nothing
Set olRule = Nothing
End Sub
--
any help is greatly appriciated!!