Solved

How to force a hard return in XML for office ribbon

Posted on 2009-04-08
4
1,240 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
[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
  • 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
 
LVL 1

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
 
LVL 1

Author Comment

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

Featured Post

Industry Leaders: 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

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
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…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

623 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