Mega Code Archive

 
Categories / VisualBasic Script / Application
 

Adding a control to a command bar

Sub AddButton()     Set NewBtn = CommandBars("MyToolbar").Controls.Add _       (Type:=msoControlButton)     With NewBtn        .FaceId = 300        .OnAction = "MyMacro"        .Caption = "Tooltip goes here"     End With End Sub