Solved

How to force a hard return in XML for office ribbon

Posted on 2009-04-08
4
1,076 Views
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
Elmo

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">

<ribbon startFromScratch="false">

<tabs>

 

<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" />

</group>

 

</tab>

</tabs>

</ribbon>

</customUI>

Open in new window

0
Comment
Question by:cErasmus
  • 2
  • 2
4 Comments
 
LVL 11

Expert Comment

by:CraigYellick
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:

   &quot;

The CR chacter is ASCII 13 so the encoding is:

    &#13;

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

0
 

Author Comment

by:cErasmus
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.
Elmo
0
 
LVL 11

Accepted Solution

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

    &#13;&#10

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.

http://www.accessribbon.de/en/index.php?Access_-_Ribbons:Ribbon_Attributes
0
 

Author Comment

by:cErasmus
ID: 24122432
Thanks Craig the supertip did the trick
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

910 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

21 Experts available now in Live!

Get 1:1 Help Now