Solved

How to force a hard return in XML for office ribbon

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
This article will show you how to use shortcut menus in the Access run-time environment.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
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 …

747 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

11 Experts available now in Live!

Get 1:1 Help Now