Results 1 to 14 of 14
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how do I make a menu view disabled? (Office XP SP3)

    Hi

    When there are no documents in the window I noticed some of Words menus are disabled. eg the File> Close, File>Save, File>Print. although these menu options appear the menu options are disabled. I have a custom Word drop down menu, and when there are no documents I too would like my custom menu options disabled.

    how do I do this?
    diana

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: how do I make a menu view disabled? (Office XP SP3)


  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how do I make a menu view disabled? (Office XP SP3)

    cheers Hans - Diana

  4. #4
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how do I make a menu view disabled? (Office XP SP3)

    Hi Hans

    Thanks for the website links. The websites mention the command bars or toolbars.

    I was wanting to disable a button on the 'File menu' .
    any ideas on how to do this?

    many thanks diana :-)

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: how do I make a menu view disabled? (Office XP SP3)

    The menu bar is a command bar, just like the toolbars. For instance, to disable the "Save" option on the file menu, use

    Application.CommandBars("File").Controls("Save").E nabled = False

    You can also use the ID for the "Save" menu item:

    Application.CommandBars("File").FindControl(ID:=3) .Enabled = False

  6. #6
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how do I make a menu view disabled? (Office XP SP3)

    thankyou Hans.

    I'm wanting to place this code in my class Application Events. Im trying to step thru this code but it wont let me. Is there another way to step into the Application Events? My event is
    Private Sub App_DocumentChange()

    many thanks Diana :-)

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: how do I make a menu view disabled? (Office XP SP3)

    Single stepping through application-level events is tricky. You might put the code in a procedure in a standard module and call that procedure from the event procedure in the class module. That would allow you to test the procedure by itself.

  8. #8
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how do I make a menu view disabled? (Office XP SP3)

    yes it is tricky. i'm currently doing your suggestion now.

    many thanks again hans...diana :-)

  9. #9
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how do I make a menu view disabled? (Office XP SP3)

    In this book a method will be described which frees you of having to track the number of docs open or the status of the application because one "hooks" ones own menu to the standard menu controls in Excel, thus making your own menu enable/disable automatically together with the ones you used as the "source" control. NDA prevents me from revealing the code unfortunately.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: how do I make a menu view disabled? (Office XP SP3)

    Will that work in Word too? That's the application Diana is using.

  11. #11
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how do I make a menu view disabled? (Office XP SP3)

    I am pretty sure it will, I'll try.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  12. #12
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how do I make a menu view disabled? (Office XP SP3)

    This is a demo in Word.
    I protected the VB project though, sorry.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: how do I make a menu view disabled? (Office XP SP3)

    Yep, that works.

  14. #14
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how do I make a menu view disabled? (Office XP SP3)

    thanks diana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •