R
Rivers
The code below is a toolbar that uses a menu option and then also a sub menu
but i cant figure out how to get the sub menu buttons to add to it can anyone
help
rivers
Sub newbar1()
Application.ScreenUpdating = False
On Error Resume Next
Application.CommandBars("saveas").Delete
With Application.CommandBars.Add
.Name = "Saveas"
.Visible = True
.Position = msoBarTop
' Help
Set cbp = CommandBars("saveas").Controls.Add(Type:=msoControlPopup,
Temporary:=False)
cbp.Caption = "Help.."
Set mysubmenu = cbp.Controls.Add(Type:=msoControlPopup)
With mysubmenu
..Caption = "Useful Websites"
End With
Set check = mysubmenu.Controls.Add(Type:=msoControlButton)
With check
Set cbb = check.Controls.Add
cbb.Caption = "Google"
cbb.OnAction = "google1"
cbb.Style = msoButtonIconAndCaption
cbb.FaceId = 9026 '218 + ictr
cbb.TooltipText = "Search engine"
End With
End With
End Sub
but i cant figure out how to get the sub menu buttons to add to it can anyone
help
rivers
Sub newbar1()
Application.ScreenUpdating = False
On Error Resume Next
Application.CommandBars("saveas").Delete
With Application.CommandBars.Add
.Name = "Saveas"
.Visible = True
.Position = msoBarTop
' Help
Set cbp = CommandBars("saveas").Controls.Add(Type:=msoControlPopup,
Temporary:=False)
cbp.Caption = "Help.."
Set mysubmenu = cbp.Controls.Add(Type:=msoControlPopup)
With mysubmenu
..Caption = "Useful Websites"
End With
Set check = mysubmenu.Controls.Add(Type:=msoControlButton)
With check
Set cbb = check.Controls.Add
cbb.Caption = "Google"
cbb.OnAction = "google1"
cbb.Style = msoButtonIconAndCaption
cbb.FaceId = 9026 '218 + ictr
cbb.TooltipText = "Search engine"
End With
End With
End Sub