Macro to run when opening doc

  • Thread starter Thread starter Antonio
  • Start date Start date
A

Antonio

Hi all

Is there any way to make a macro run when opening a specific document??

Tks in advance
António
 
Hi Antonio,

Yes, you can name the macro 'AutoOpen' or call it from a macro so-named in a normal code module.

Alternatively, you can use a 'Document_Open' macro in the document's 'ThisDocument' module, instead of the 'AutoOpen' macro.
 
While the methods suggested by macropod will work (if the macro is stored in
the document - or its template and that template is available to the user)
the problem with macros in documents is persuading users to allow them to
run. There is no way to force users to run macros.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
There is no way to force users to run macros.
Which is a good thing - otherwise the macro-virus writers would have a field day.
 
Back
Top