How to force a hard return in XML for office ribbon

Posted on 2009-04-08
Last Modified: 2012-06-27
Hi All
The code below adds a button to the ribbon in Excel 2007. The problem Im having is that the tooltip is all added in one line. Is there a way to make it go to the next line so it looks something like this?
Prepare an MS Word document with
 suppliers profiles and automatically
 e-mail it to them. The document will
 contain the name of the company,
and where available the name of the
 contact person. The template must
 be available in C:\Data\SupplierProfile.docx.
Thanks in advance

<customUI xmlns="">
<ribbon startFromScratch="false">
<tab id = "customTab" label="Tara Nawa" insertAfterMso="TabView">
<group id="eMail" label="e-Mail">
<button id="btnPerSupProf" screentip="Prepare an MS Word document with suppliers profiles and automatically e-mail it to them. The document will contain the name of the company, and where available the name of the contact person. The template must be available in C:.docx." label="Personalized-Supplier Profile" onAction="CallControl"  imageMso="Magnifier" />

Open in new window

Question by:cErasmus
  • 2
  • 2
LVL 11

Expert Comment

ID: 24115958
It is up to the application that uses the attribute value to decide whether or not to "respect" any CR+LF characters present. The tooltip might break on lines or it might show those box characters that represent symbols that cannot be displayed in the current font.

In any event, XML supports the encoding of special characters by preceding with an ampersand and terminating with a semicolon.  For example to put a quote character inside the quoted attribute value, use:


The CR chacter is ASCII 13 so the encoding is:


If that does not do the trick you may need to include the LF (ascii 10) character as well.

   screentip="Prepare an MS Word document with suppliers &#13;profiles ..."

Open in new window


Author Comment

ID: 24121737
Hi Craig
I tried
screentip="Prepare an MS Word document with suppliers &#13;profiles ..."
screentip="Prepare an MS Word document with suppliers &#10;profiles ..."
screentip="Prepare an MS Word document with suppliers &#13; &#10;profiles ..."
and neither of them work. I get the box charcater where i put 10.
LVL 11

Accepted Solution

CraigYellick earned 500 total points
ID: 24122358
If the text requires a CR+LF together then you cannot put a space between them.


One more thing you could try is the @ symbol. That used to work with Message Box message text in older versions of Office. A long shot but worth a try.

Another long shot is to put line breaks in the definition of the attribute text. Not sure if that kind of whitespace is preserved by Office but it might.

This page mentions a "supertip" attribute which does support line breaks, but in the context of the ribbon bar. Might be supported for other controls.

Author Comment

ID: 24122432
Thanks Craig the supertip did the trick

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

856 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