Forum Thread: How to Make a Macro Run Automatically?

How to Make a Macro Run Automatically?

hey guys

we all know that in order for a ms word/excel macro attack to succeed, the victim has to click "enable content" so that the macro runs....but i wonder if any of you knows a method to make the macro run automatically as soon as the victim opens the document, without the need to click "enable content" (less suspicious) ? says that if you name the macro Auto_Open, it would run automatically...but i tried it, and removed the underscore when using it with ms word (AutoOpen), still the message "Enable macros" pops up. any clues?

5 Responses

In the Macro edit windows, open "This Document" on the right panel and add:

Private Sub DocumentOpen()

'Greet user.

MsgBox "Greetings", vbOKOnly, "Surprise !"

End Sub

tried it, but it's not working. this is a picture of the macro

I tested it and it's working like a charm on word2010.

Btw i have the file "This document" at the root of Project directory by default.

so when you open the file, it doesn't prompt you to enable macros?

haha, i missunderstood what u wanted to do, sorry :)

So a semi-solution for that would be to self sign your document, but the user will have to accept the first time too.
You could also try to lower the document security by another wayin order to accept every macro by default.

Share Your Thoughts

  • Hot
  • Active