Macro for opening

H

helenp

I want to write a macro that will cause two things to
happen when that specific document is opened, no matter
how a previous user left it. I want a certain custom
toolbar to be visible, and the document to open in
protected mode. Any ideas? My brain is turning to rubber
here...

Thanks!
 
A

Alex Ivanov

In "ThisDocument" (unless you changed the name) code module type

Private Sub Document_Open()
ActiveDocument.Protect wdAllowOnlyFormFields
Word.Application.CommandBars("MyCustomToolBar").Visible = True
End Sub

and save the document.

HTH
 
G

Guest

Perfect, and thanks! I knew it had to be something
simple, but my VBA is non-existent...

Helen
-----Original Message-----
In "ThisDocument" (unless you changed the name) code module type

Private Sub Document_Open()
ActiveDocument.Protect wdAllowOnlyFormFields
Word.Application.CommandBars
("MyCustomToolBar").Visible = True
 

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