Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2004

Tip: Looking for answers? Try searching our database.

Remove a MENU ITEM.????

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alok - 27 Dec 2004 10:55 GMT
Hi all,
Is their any way i can remove a menu item when my document is opened .

Or if i can disable the Menu Item.Would also do.

Thanks ,
Alok
Helmut Weber - 27 Dec 2004 12:06 GMT
Hi Alok,

in principle: CommandBars("File").Controls(16).Enabled = False.

But that would apply to the template, not to your document, usually.

And there may be other ways, to execute the specific command.
You could intercept the according macro and make it's
execution dependent of the activedocument.
There are numerous examples here.

I'd rather not remove a control, as that would rise the question,
how to get it back, and it usually effects the attached template.

With lots of preconditions and exceptions, I suppose.

You may find the following helpful.
By the way, there should be a textual representation
of the control's index, but I see no way to get it,
here with my german version.

With CommandBars("File").Controls
For i = 1 To .Count
  Debug.Print Format(i, "00 ") & .Item(i).Caption
Next
End With

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.