Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Toolbar

Status
Not open for further replies.

ghloid

IS-IT--Management
Mar 11, 2002
85
US
Hello all,

I have one of these "I think this should be easy, but I just don't know it" type of questions. I'm looking for a way to display a certain toolbar ("Admit States" is the name of the toolbar) when a user opens a Word Doc (the event should be triggered on the particular docment's open event). Likewise, I'd like the toolbar to be hidden when the user leaves the document (on the document close event I believe). I don't see much mention of how to do this in the VBA help available in Word. Microsoft did have an article which may be in the direction of what I'm looking for (article 213487), but that reference is really detailing how to show then hide EVERY toolbar. I think that's a good starting point, but I'm still a little confused on how to make it work.

If anyone has any ideas, I'd greatly appreciate it.

THANKS!!!
 
Hi,

In the module ThisDocument you put the following code :

Private Sub Document_Close()
Me.CommandBars("TheName").Visible = False
End Sub


Private Sub Document_Open()
Me.CommandBars("TheName").Visible = True
End Sub


Jean-Paul
Montreal
jp@solutionsvba.com
mtljp2@sympatico.ca
 
BEAUTIFUL!!

Thanks for your help with this. Sorry I didn't get back to ya sooner on it, but I never got an email saying I had a response (d'oh).

I knew it should be simple though, and your code looks like it should work.

THANKS!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top