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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting rid of a Menu Bar 1

Status
Not open for further replies.

michaelbr55

Programmer
Oct 8, 2002
70
I have a template with which I create a document and even though the template does not have the "Mail Merge" menu when I create a new document based on the template the "Mail Merge" menu is visible. How can I get rid of this once and for ever!

[pipe] Mike.
 
Hi Mike
I'm not too good with Word VBA and the following isn't fully tested but should do the trick.

Put this in the DOCUMENT module of the TEMPLATE

Code:
Private Sub Document_New()
CommandBars("Mail Merge").Enabled = False
End Sub

It may be more sensible to use .Visible instead of .Enabled but that depends on whether you want the toolbar available at all.

This FAQ may also be of some interest to you
How can I Disable/Enable CommandBars and/or Controls faq707-4841

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
Thanks Loomah,
While it most certainly would have been more sensible to make the bar ".visible=false" I had tried that and it just didn't work, but the ".enabled=false" works a treat. I don't think users of the template will want the Mail Merge menu anyway, and tough if they do!
Thanks again, a star for you!

[pipe] Mike.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top