Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reseting shortcut menus (VBA Word 2000)

    I've tried several ways, but I can't seem to programmatically reset the "Shortcut Menus" toolbar for a document. This is the equivalent of the following manual process:

    1) On the Tools menu, click Customize.
    2) On the Toolbars tab, click Shortcut Menus.
    3) Click Reset.
    4) In the Reset Toolbar window, select the name of the active document, and click OK.

    I can reset the lowest level folder, such as "Fields" as follows:

    CustomizationContext = ActiveDocument
    CommandBars("Fields").Reset

    But I'd like to be able to reset all the shortcut menus at once.

    Thanks again!!
    Troy

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Reseting shortcut menus (VBA Word 2000)

    Troy,

    Try something like this (on a scratch document - haven't tested it fully):

    <pre>Dim CBar As CommandBar
    CustomizationContext = ActiveDocument
    For Each CBar In ActiveDocument.CommandBars
    If CBar.Type = msoBarTypePopup Then
    CBar.Reset
    End If
    Next 'CBar
    </pre>


    This might though reset more than just the shortcut menus - don't know if that matters in your situation.

    Gary

  3. #3
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Reseting shortcut menus (VBA Word 2000)

    This was just what I was looking for!! Especially the:

    If CBar.Type = msoBarTypePopup

    That was the key I was missing.

    F.Y.I. I tested this and can't find anything this does that I would not want. It added (temporarily) a msgbox that showed the name of each commandbar whose type= msoBarTypePopup, and that only seemed to cover what was in the Shortcut menu.

    Thanks for the help!!
    Troy

Posting Permissions

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