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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force LineBreak in CommandBarButton Caption

Status
Not open for further replies.

ACH381

Technical User
Apr 3, 2002
49
US
I want to split two words in a commandbarbutton (msoControlButton) caption to be on two lines. I tried this:

Set tlbSpell = Bar620.Controls.Add(msoControlButton)
tlbSpell.Style = msoButtonWrapCaption
tlbSpell.Caption = "Spell" & Chr(13) & "Check"
tlbSpell.OnAction = "RunSpellCheck"

but it did not work. How do I get Spell Check to show up with the word 'Check' under the word 'Spell'?
 
Did you try this ?
tlbSpell.Caption = "Spell" & Chr(10) & "Check"
or this ?
tlbSpell.Caption = "Spell" & vbCrLf & "Check"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV: Thanks for the quick response but neither of those work either. I've done this several years ago but I'm having a mental block. I'll keep searching.
 
Additional Information: This is an Office 2007 (probably ribbon) issue. Using all the options already suggested in previous threads work in Office 2000, wrapping the text as expected, but when opened in Office 2007 and Office 2010 the line feed character is ignored. So if anyone has an idea on how to make this work on the Ribbon, please post it. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top