How to Run AutoOpen Macro when Winword open new Document

M

moonhkt

Hi Reader

In Normal.dot, Add AutoOpen and AutoNew sub, But, when I click winword
shutcut, the word just create blank document1 without run AutoOpen
sub. How to setup ?

Also, I want add Menu in Normal.dot. How to setup ?


Sub Autoopen()
'~~ VBA
Call PerActiveMenu
End Sub

Sub AutoNew()
MsgBox "new"
End Sub

Sub PerActiveMenu()
MsgBox "dd"
End Sub
 
G

Graham Mayor

Autoopen macros run when you open an existing document. You need a an
autonew macro to run when a new document is created. When you customize the
menus you can indicate which document or template in which you want the menu
in the customize dialog. Ensure that you later save the document or
template.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

moonhkt

Autoopen macros run when you open an existing document. You need a an
autonew macro to run when a new document is created. When you customize the
menus you can indicate which document or template in which you want the menu
in the customize dialog. Ensure that you later save the document or
template.

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

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>









- $Bp}<(Ho0zMQJ8;z(B -

Thank. I try to open existing Document, The AutoOpen Macro Worked.
How to Add Menu when winword icon click ?
 

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