Link to home
Start Free TrialLog in
Avatar of edc
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.Add("Custom")
    Set cbutton = CommandBars("Controls").Controls.Add(Type:=msoControlButtonDropdown)
    barNewBar.Visible = True
       
End Sub
ASKER CERTIFIED SOLUTION
Avatar of ChrisLewis
ChrisLewis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of edc
edc

ASKER

Microsoft gave me a bit of a work around on this one, but not with all the functionality that I was hopeing for.  It's not possible in the conventional sense of adding a button, but it can be done to a limited degree.