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 / November 2004

Tip: Looking for answers? Try searching our database.

How to Enable/Disable Word Default Menus

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Becky Carter Hickman-Jones - 23 Nov 2004 19:58 GMT
Hi again,

I have a custom global template that disables certain menu commands upon
launching Word XP. I would like to reinstate some of those menus, but I
can't find the bit of code in the macros that disables these commands. Would
someone be able to give me an example of how one enables or disables menu
items in VBA? From that, I could search the template and possibly track down
the code I need to change.

Thank you,
Beck
Charles Kenyon - 23 Nov 2004 22:00 GMT
I would try, instead, disabling the menu commands in your template, either
manually or through code, once. Absent other weird Add-Ins, they will be
disabled when your template is loaded and not disabled when it is not
loaded.

Otherwise, your code would need to be very careful of the customization
context to avoid acting like a virus and permanently changing the interface.

If you would specify which menus/toolbars you are disabling someone here can
probably take a guess at what your code looks like. It will probably have
the term ".enabled = "false"" in it.

If you are hiding the standard or formatting toolbars your code would have
".visible = "false"" in it as well. You would want your exit code to reset
these to what they were when you started your code. These settings could be
saved in variables.

What follows is some code from one of my Add-Ins that changes toolbar
settings.
   Word.CommandBars("MyTools MenuBar Chas").Visible = False
   Word.CommandBars("MyTools MenuBar Chas").Enabled = False
   Word.CommandBars("Formatting Toolbar Holder Chas").Visible = False
   Word.CommandBars("Formatting Toolbar Holder Chas").Enabled = False
   With CommandBars("Macros")
       .Left = 521
       .Top = 23
       .Height = 28
       .Visible = True
       .Position = 1
   End With
   With CommandBars("CDEVTools Kenyon")
       .Left = 228
       .Top = 23
       .Height = 28
       .Visible = True
       .Position = 1
   End With

The first part disables a couple of command bars that are in the template
(they are only used for development, not general work). The sets of With
structures position two of the command bars where I want them.

Hope this helps.
Signature


Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

> Hi again,
>
[quoted text clipped - 9 lines]
> Thank you,
> Beck
Becky Carter Hickman-Jones - 24 Nov 2004 00:12 GMT
Thanks Charles. Specifically, the template that I am using disables the
Tools > Macro command. I would like to turn it back on, and I've looked
through the template code to find CommandBars, and I do find a few
instances, but none of them references tools or macro, so I'm at a bit of a
stop.

> I would try, instead, disabling the menu commands in your template, either
> manually or through code, once. Absent other weird Add-Ins, they will be
[quoted text clipped - 52 lines]
> > Thank you,
> > Beck
Charles Kenyon - 24 Nov 2004 23:43 GMT
Put a (null) macro into your template that intercepts the command. See the
MVP FAQ on vba for details on how to do this.
Signature


Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

> Thanks Charles. Specifically, the template that I am using disables the
> Tools > Macro command. I would like to turn it back on, and I've looked
[quoted text clipped - 67 lines]
>> > Thank you,
>> > Beck

Rate this thread:






 
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.