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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Sort data 2
countif?? 14
Count !!! 2
Templates 10
wheeling numbers 4
Template 2
Can't export a report to word 2
Comparing Data 4

Back
Top