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 / Menus and Toolbars / February 2005

Tip: Looking for answers? Try searching our database.

Enable/Disable custom menus?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ML - 24 Feb 2005 16:12 GMT
How do you enable/disable custom menu items in code?
I need to be able to control this based on a userform selection for specific
submenus on a custom template menu.
Graham Mayor - 24 Feb 2005 16:23 GMT
Lookup CommandBars in vba help.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> How do you enable/disable custom menu items in code?
> I need to be able to control this based on a userform selection for
> specific submenus on a custom template menu.
ML - 24 Feb 2005 16:34 GMT
I have tried this but it does not work, gives invalid procedure call.

CommandBars("ABC").Enabled = false

> Lookup CommandBars in vba help.
>
>> How do you enable/disable custom menu items in code?
>> I need to be able to control this based on a userform selection for
>> specific submenus on a custom template menu.
ML - 24 Feb 2005 16:38 GMT
CommandBars("ABC").Enabled = false

Seems to work for built in menus but if I give it the name of my custom menu
it give the error.  Can you not reference a custom menu directly by name?

>I have tried this but it does not work, gives invalid procedure call.
>
[quoted text clipped - 5 lines]
>>> I need to be able to control this based on a userform selection for
>>> specific submenus on a custom template menu.
Graham Mayor - 24 Feb 2005 17:01 GMT
It works for me.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> CommandBars("ABC").Enabled = false
>
[quoted text clipped - 19 lines]
>>>> I need to be able to control this based on a userform selection for
>>>> specific submenus on a custom template menu.
ML - 24 Feb 2005 17:12 GMT
:(

I can't get it working at all.  If I walk through the commandbars collection
there is no "ABC" menu which is my custom menu that is saved in the
template.

Is there something special that needs to be done when trying to reference a
custom menu item?

> It works for me.
>
[quoted text clipped - 21 lines]
>>>>> I need to be able to control this based on a userform selection for
>>>>> specific submenus on a custom template menu.
ML - 24 Feb 2005 17:16 GMT
FYI - This is a custom menu that is placed on the main Word menubar, not a
toolbar item.   Not sure if that makes a difference or not.  As I say it
does not appear in the commandbars collection at all.

> It works for me.
>
[quoted text clipped - 21 lines]
>>>>> I need to be able to control this based on a userform selection for
>>>>> specific submenus on a custom template menu.
Graham Mayor - 24 Feb 2005 17:24 GMT
I think you are going to have to take this to the vba newsgroup where wiser
heads than mine abound.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> FYI - This is a custom menu that is placed on the main Word menubar,
> not a toolbar item.   Not sure if that makes a difference or not.  As
[quoted text clipped - 34 lines]
>>>>>> I need to be able to control this based on a userform selection
>>>>>> for specific submenus on a custom template menu.
ML - 24 Feb 2005 17:27 GMT
Ok thanks.  I tried there as well but no reply so far.  Thank for your help.

>I think you are going to have to take this to the vba newsgroup where wiser
> heads than mine abound.
[quoted text clipped - 37 lines]
>>>>>>> I need to be able to control this based on a userform selection
>>>>>>> for specific submenus on a custom template menu.
Richard Gadsden - 24 Feb 2005 18:25 GMT
> FYI - This is a custom menu that is placed on the main Word menubar, not a
> toolbar item.   Not sure if that makes a difference or not.  As I say it
> does not appear in the commandbars collection at all.

Yes - that makes it a property of the Command Bar that the main Word
menu bar is in.  Walk through CommandBars until you find the menu bar (I
think it's called something like "Menu Bar") and then walk through the
Controls on that bar - one of those should be the menu.

Signature

Richard Gadsden
"I disagree with what you say, but I will defend to the death
your right to say it" - Attributed to Voltaire

ML - 24 Feb 2005 18:56 GMT
Thank you!  That is what I was missing, the Menu Bar level.

>> FYI - This is a custom menu that is placed on the main Word menubar, not
>> a toolbar item.   Not sure if that makes a difference or not.  As I say
[quoted text clipped - 4 lines]
> it's called something like "Menu Bar") and then walk through the Controls
> on that bar - one of those should be the menu.
Charles Kenyon - 25 Feb 2005 15:45 GMT
The command structure you are using will only work for the entire toolbar,
not for part of it. You may be able to get the particular item (your menu)
on the command bar. As Graham suggested, the vba groups, especially the
customization group, would be your best bet. Be patient.

The following in the immediate window on my system reports back: &File
telling me I've reached the File menu on the Menu Bar:

? CommandBars(41).Controls(1).caption

Hope this helps get you on track.
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.

> FYI - This is a custom menu that is placed on the main Word menubar, not a
> toolbar item.   Not sure if that makes a difference or not.  As I say it
[quoted text clipped - 25 lines]
>>>>>> I need to be able to control this based on a userform selection for
>>>>>> specific submenus on a custom template menu.
 
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.