edc
asked on
Visual Basic for Applications (Office 97) adding Buttons to a toolbar
I'm trying to add a button to a toolbar in Word '97. But wait! It's not as simple as it sounds. The specific button type is actually msoControlButtonDropdown. I can add msoControlButton and msoControlComboBox to a toolbar, but thats it. Anything else gives me some sort of error, whether it be a compiler error, or whether it be another generic error of somesort. Below is a piece of example code.
Sub CreateToolbar()
Dim cbarNewBar As CommandBar
Set cbarNewBar = Application.CommandBars.Ad d("Custom" )
Set cbutton = CommandBars("Controls").Co ntrols.Add (Type:=mso ControlBut tonDropdow n)
barNewBar.Visible = True
End Sub
Sub CreateToolbar()
Dim cbarNewBar As CommandBar
Set cbarNewBar = Application.CommandBars.Ad
Set cbutton = CommandBars("Controls").Co
barNewBar.Visible = True
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER