mallycat
11-06-2012, 11:46 AM
I want to trap the normal email sending so that I can turn off a rule, then turn the rule back on after my special message has been sent. I have written the following code, but I don't know the syntax to send an actual email (I will have the email I want to send OPEN and want to send it via the Quick Access Toolbar.
I have issues with the line Application.ActiveWindow.Send
Sub Send_Immediately()
Dim olRules As Outlook.Rules
Dim olRule As Outlook.Rule
Set olRules = Application.Session.DefaultStore.GetRules
Set olRule = olRules.Item("Defer email send by 1 minute")
olRule.Enabled = False
olRules.Save
Application.ActiveWindow.Send
olRule.Enabled = True
olRules.Save
Set olRules = Nothing
Set olRule = Nothing
End Sub
I have issues with the line Application.ActiveWindow.Send
Sub Send_Immediately()
Dim olRules As Outlook.Rules
Dim olRule As Outlook.Rule
Set olRules = Application.Session.DefaultStore.GetRules
Set olRule = olRules.Item("Defer email send by 1 minute")
olRule.Enabled = False
olRules.Save
Application.ActiveWindow.Send
olRule.Enabled = True
olRules.Save
Set olRules = Nothing
Set olRule = Nothing
End Sub