Discussion Locked

how to auto run a macro from outlook?

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How to auto run a macro script in VBA of Microsoft outlook

5 replies

by charliespencer

You posted this under Questions, which is where it properly belongs. Please don't post questions under Discussions, and don't post the same question in multiple places.

by bschaettle

Put your code in:

Private Sub Application_Startup()
...
End Sub

Check Tools+Macro+Security to be sure macros are allowed to run.

by aline

thx it's working but i still have one problem,
if I close the outlook from the task bar the macro stop running

by ts13831

Does anyone have thoughts as to why this Sub Application_Startup()doesn't work for me? I have Macro Security set to low. To test the sub, I inserted MSGBOX "Hello" between the two lines of code - nothing. I am trying to use the startup sequence to expose a VBA function within Outlook.

by aacinc

You can place code in the ThisOutlookSession.

Private Sub Application_MAPILogonComplete()

Call your macro1
Call your macro2

End Sub

This discussion is closed to new replies.