J
James H
I just had a machine upgrade at work and now my VBA new
mail handler isn't running. Here's what I did to set it up:
1. Copy the code into a notepad file. Open the file on the
new machine, paste it into the Outlook session.
2. Use selfcert.exe to give the code a digital signature.
3. Set the macro security to medium.
4. Log out of Outlook, then relaunch. Outlook asks me if I
want to enable or disable macros. I say "enable."
From then on, I can run the macros manually (and they
work, so my code isn't at fault), but the new mail handler
never kicks in.
Here's the start of my code:
Dim WithEvents myOlApp As Outlook.Application
Sub Initialize_handler()
Set myOlApp = CreateObject("Outlook.application")
End Sub
Private Sub Application_NewMail()
Call DeleteOldContaining("Hourly Pendings")
Call DeleteOldContaining("Hourly Teams")
End Sub
.... any ideas? What step am I missing?
hjh
mail handler isn't running. Here's what I did to set it up:
1. Copy the code into a notepad file. Open the file on the
new machine, paste it into the Outlook session.
2. Use selfcert.exe to give the code a digital signature.
3. Set the macro security to medium.
4. Log out of Outlook, then relaunch. Outlook asks me if I
want to enable or disable macros. I say "enable."
From then on, I can run the macros manually (and they
work, so my code isn't at fault), but the new mail handler
never kicks in.
Here's the start of my code:
Dim WithEvents myOlApp As Outlook.Application
Sub Initialize_handler()
Set myOlApp = CreateObject("Outlook.application")
End Sub
Private Sub Application_NewMail()
Call DeleteOldContaining("Hourly Pendings")
Call DeleteOldContaining("Hourly Teams")
End Sub
.... any ideas? What step am I missing?
hjh