Discussions

how to auto run a macro from outlook?

Tags:
+
0 Votes
Locked

how to auto run a macro from outlook?

aline
How to auto run a macro script in VBA of Microsoft outlook
  • +
    0 Votes
    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.

    +
    0 Votes
    bschaettle

    Put your code in:

    Private Sub Application_Startup()
    ...
    End Sub

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

    +
    0 Votes
    aline

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

    +
    0 Votes
    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.

    +
    0 Votes
    aacinc

    You can place code in the ThisOutlookSession.

    Private Sub Application_MAPILogonComplete()

    Call your macro1
    Call your macro2

    End Sub

  • +
    0 Votes
    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.

    +
    0 Votes
    bschaettle

    Put your code in:

    Private Sub Application_Startup()
    ...
    End Sub

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

    +
    0 Votes
    aline

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

    +
    0 Votes
    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.

    +
    0 Votes
    aacinc

    You can place code in the ThisOutlookSession.

    Private Sub Application_MAPILogonComplete()

    Call your macro1
    Call your macro2

    End Sub