Right now all of my VBA code is in ThisOutlookSession
. I want to put everything in a module so I can export it and other folks can import it without having to muck around with their own ThisOutlookSession
. I want it to be easy for the user -- the user just imports my module file.
My code depends on Application_MAPILogonComplete
and WithEvents
. Neither of these are available/work in a module.
I see that classes have a Class_Initialize
but it only triggers when a class object is initialized so I'd still need some kind of Application_MAPILogonComplete
event.
Is there anyway to do what I want? Keep everything in a module or class that can be exported and imported that has code run when Outlook opens and supports WithEvents
so I can execute a function when new e-mails are added to a folder?