• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 554
  • Last Modified:

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
0
edc
Asked:
edc
1 Solution
 
ChrisLewisCommented:
The add method of CommandBars only supports the following types:
msoControlButton
msoControlEdit
msoControlDropdown
msoControlComboBox
msoControlPopup

I don't believe that it is possible at this time to add a button drop down in VBA to Word97.

Sorry

Chris


0
 
edcAuthor Commented:
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.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now