Visual Basic for Applications (Office 97) adding Buttons to a toolbar
Posted on 1997-06-18
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.
Dim cbarNewBar As CommandBar
Set cbarNewBar = Application.CommandBars.Add("Custom")
Set cbutton = CommandBars("Controls").Controls.Add(Type:=msoControlButtonDropdown)
barNewBar.Visible = True