Solved

How to force a hard return in XML for office ribbon

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

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 (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) 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