?
Solved

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

Posted on 1997-06-18
2
Medium Priority
?
539 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
ChrisLewis earned 400 total points
ID: 1427425
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
ID: 1427426
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

800 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