0

My company has set the policy of not allowing macros by default. By my understanding, this just means that i can't import macro by default, however i can still run my code if i do Alt+F11 and paste codes inside ThisOutlookSession . I've successfully got all the code working, but after restarting my PC, manually pasting the code in ThisOutlookSession doesn't work anymore and the codes are already pasted in by default. Even doing MsgBox in the NewMailEx event doesn't work. I've googled around and the general consensus is that a workaround is to delete ThisOutlookSession in AppData. However i can't access AppData as well as enable all/some macros.

Is there any workaround, Eg. Can I access Outlook application through Excel and "intercept" NewMailEx Since I've determined that Excel works through the VBA even when restarted. All i have to do is copy and paste the code in again.

TL;DR: ThisOutlookSession doesn't work after I reset my PC. Unable to access AppData and modify Macro Settings. Seeking workaround for example, open Excel and getting mail from Outlook via VBA if possible?

Thanks for the help!

Pᴇʜ
  • 53,845
  • 9
  • 46
  • 68
  • 1
    If your company restricts running macros: Respect that! It is not your business to undermine the security decisions of those in charge. • If you need to run macros go the offical way and contact the responsible administrator or your supervisor. • Actually if I would have restricted macros in my company and I found out that someone doesn't respect that decision, that would be a reason for a formal warning letter. If I was you I wouldn't risk my job for that. – Pᴇʜ Mar 01 '21 at 07:13
  • Does this answer your question? [Utilizing Outlook Events From Excel](https://stackoverflow.com/questions/35894485/utilizing-outlook-events-from-excel) – niton Mar 17 '21 at 17:07

0 Answers0