AutoOpen - How to Hide it from Alt-F8

V

VBA Coder

I have an AutoNew subroutine that is declared as Public, so that when a user
creates a new document from our template, this code will be the first thing
to run. How can I have this subroutine hidden from the list of available
Macros that the user can run? If the user clicks Alt-F8, they are presented
with a list of Macros, including my "AutoNew" macro. If I change it to a
Function, it will not show, however, by changing it to a Function will
prevent it from running when the user creates a new document.
 
C

Charles Kenyon

Set it up in the ThisDocument object as a Document_New procedure. It won't
show up in the macros list and will run when a new document is created based
on your template.

Private Sub Document_New()
MsgBox "Hi there."
End Sub

--

Charles Kenyon

Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>

See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

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

Top