D
dominicb
Hi all
I have a problem with a toolbar I'm developing. What I want to do i
have a
tick button next to the sub-menu item (Show New Toolbar) usin
msoButtonUp /
Down. I can sort out the syntax to do this to the main menu ite
(Toolbar)
but am struggling to get it next to the sub-menu. This is a portion o
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
Domini
I have a problem with a toolbar I'm developing. What I want to do i
have a
tick button next to the sub-menu item (Show New Toolbar) usin
msoButtonUp /
Down. I can sort out the syntax to do this to the main menu ite
(Toolbar)
but am struggling to get it next to the sub-menu. This is a portion o
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
Domini