Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel97 Command Bar - How do I create a Text Only item? 1

Status
Not open for further replies.

ssmgr

Technical User
Feb 2, 2003
40
AU
I'm using Excel97, and have created a floating command bar containing a single control. I want the control to display as Text Only (Always), not as an icon. Any ideas? This is what I have so far:

Application.CommandBars.Add Name:="Module1", Position:=msoBarFloating, temporary:=False

With Application.CommandBars("Module1")
.Visible = True
.Controls.Add Type:=msoControlButton, Id:=2949, Before:=1
.Controls(1).Visible = True
With .Controls(1)
.Caption = "Description"
.TooltipText = "Description"
.DescriptionText = "Description"
.Tag = "Description"
End With
End With

This creates the floating bar, puts an icon on it, but doesn't display the text. In the on-line system, I could use the Customize Toolbars dialogue to Modify Selection, and then change the control's Style to Text Only (Always). However, I can't work out how to do that in VBA. I'm a bit lost, and would appreciate any suggestions.

Thanks,
Steve
 
Hi ssmgr,

Take a look at the Button's Style Property. Setting it to msoButtonCaption should do what you want.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Thanks Tony, that's exactly what I wanted to do. I've spent hours trying to work it out, and you're tip has fixed it for me in no time at all, so I've given you a star.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top