Solved

Visual Basic for Applications (Office 97) adding Buttons to a toolbar

Posted on 1997-06-18
2
514 Views
Last Modified: 2013-11-25
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
Comment
Question by:edc
2 Comments
 
LVL 3

Accepted Solution

by:
ChrisLewis earned 200 total points
Comment Utility
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
 
LVL 1

Author Comment

by:edc
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now