msoButtonUp / Down for sub-menu items

D

Dominic

Hi all

I have a problem with a toolbar I’m developing. What I want to do is have a
tick button next to the sub-menu item (Show New Toolbar) using msoButtonUp /
Down. I can sort out the syntax to do this to the main menu item (Toolbar)
but am struggling to get it next to the sub-menu. This is a portion of the
code I’m using :

Sub Menu()
Dim HelpMenu As CommandBarControl, NewMenu As CommandBarPopup
Dim MenuItem As CommandBarControl, Submenuitem As CommandBarButton
Set HelpMenu = CommandBars(1).FindControl(Id:=30010)
Set NewMenu = CommandBars(1).Controls.Add(Type:=msoControlPopup,
Before:=HelpMenu.Index, temporary:=True)
NewMenu.Caption = "My Toolbars"
Set MenuItem = NewMenu.Controls.Add(Type:=msoControlPopup)
With MenuItem
..Caption = "Toolbar"
..BeginGroup = True
End With
Set Submenuitem = MenuItem.Controls.Add(Type:=msoControlButton)
With Submenuitem
..Caption = "Show New Toolbar"
..OnAction = "Macro1"
End With
End Sub

Any ideas anyone?

Thanks

Dominic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top