Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    submenus (XP SP-1)

    I am trying to put a menu item captioned
    Regards,
    Peter

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

    Re: submenus (XP SP-1)

    You need to create a menu, then drag the items to it:

    Select Tools/Customize... or right-click a toolbar and select Customize...
    In the Customize dialog, activate the Commands tab.
    Scroll the Categories list all the way down. The last item should be New Menu.
    When you select this, there is only one item in the Commands list, also named New Menu.
    Drag this to the menu bar, then click it. A small empty square will appear.
    Now, you can drag items form the Macros category (or the buttons you already put on the main menu) to this new menu.

  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: submenus (XP SP-1)

    Thank Hans, works like a charm.
    I searched through MS's help, nothing. I even tried to build it through code. Yet all MS needed was clear concise instructions like yours. Wouldn't it be great if MS's help was actually helpful, instead of being so extremely obtuse?
    Thanks again.
    Regards,
    Peter

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: submenus (XP SP-1)

    That Hans, he's always there when you need him. Me, on the other hand,
    I'm hard to find. Good show, Hans.

    Hans would have shown you how to do it with a macro, too, but you posted
    in the Word fourm and, well, protocol, you know.

    But here's some code anyway: (If you pass this sub a commandbar, like, say,
    "Menu Bar", then it'll create a new menu item, a "popup" sub item and a few sub items under that.
    The code that executes when a button is clicked is referenced in the Onaction
    property of each AppPopupMenu control.)


    Sub Test
    BuildAppMenu commandbar("Menu Bar")
    End Sub

    Sub BuildAppMenu(cBar As CommandBar)
    Dim AppPopupMenu As CommandBarControl
    Dim MenuPopUp As CommandBarPopup
    Dim MenuButton As CommandBarButton
    Dim MenuControl As CommandBarControl


    Set AppPopupMenu = cBar.Controls.Add(Type:=msoControlPopup, Before:=cBar.Controls("Help").Index, Temporary:=True)
    With AppPopupMenu
    .Caption = "Your New Menul"
    .TooltipText = "Some tooltip text."
    .OLEUsage = msoControlOLEUsageNeither
    End With

    ' 'Document Tools
    Set MenuPopUp = AppPopupMenu.Controls.Add(Type:=msoControlPopup, ID:=1, Temporary:=True)
    With MenuPopUp
    .BeginGroup = True
    .Caption = "Document Tools"
    .TooltipText = "Document-Related Utilities"
    .DescriptionText = "Document-Related Utilities"

    Set MenuButton = .Controls.Add(Type:=msoControlButton, Temporary:=True)
    With MenuButton
    .Caption = "Print File List..."
    .TooltipText = "Print a list of files in a selected folder."
    .FaceId = 1750
    .Tag = .Caption
    .OnAction = "PrintFileList"
    End With

    Set MenuButton = .Controls.Add(Type:=msoControlButton, Temporary:=True)
    With MenuButton
    .Caption = "Designate a Printer..."
    .TooltipText = "Pick a printer destination to which this document will always print."
    .FaceId = 364
    .Tag = .Caption
    .OnAction = "LaunchCommandBarSub"
    End With

    Set MenuButton = .Controls.Add(Type:=msoControlButton, Temporary:=True)
    With MenuButton
    .Caption = "Document Variables..."
    .TooltipText = "Manage Document Variables"
    .FaceId = 487
    .Tag = .Caption
    .OnAction = "LaunchCommandBarSub"
    End With

    Set MenuButton = .Controls.Add(Type:=msoControlButton, Temporary:=True)
    With MenuButton
    .Caption = "Update Footnotes"
    .TooltipText = "Format footnotes to PERB standards"
    .FaceId = 3365
    .Tag = .Caption
    .OnAction = "LaunchCommandBarSub"
    End With

    End With 'Document Tools"

    Set MenuPopUp = Nothing
    Set MenuButton = Nothing
    Set AppPopupMenu = Nothing
    End Sub
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: submenus (XP SP-1)

    Thanks Kevin. I
    Regards,
    Peter

Posting Permissions

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