PDA

View Full Version : [SOLVED:] Getting ampersand (&) symbol onto a custom ribbon label for a button



Walentyn
08-31-2020, 03:18 PM
I've been creating a custom ribbon tab using Greg Maxey's instructions in his many and varied tips pages on the subject.

I'm trying to get a label to read "F&R list" but having no success with the ampersand.

I succeeded in getting a label for the letter "a" with a macron on top of it using this in the Custom UI editor for the button: label="ā"

For ampersand, I've tried:

label="F&R list"
label="F&R list"

The Custom UI Editor doesn't respond.

I have managed a workaround with getLabel = RibbonControl.GetButtonLabel, using label = "F&&R list" in VBA, but this seems a bit roundabout.

Is there a way to write the label = "" value directly into the xml file?

Paul_Hossler
08-31-2020, 04:37 PM
Try this

Ampersand is funny on a good day




<group id="SampleGroup" label="F&amp;&amp;R List">



IIRC a single one marks the alt-shortcut key, but to actually insert one you need to double it

The XML didn't seem to like the && so I went with the named entity &#amp; twice

gmaxey
09-01-2020, 02:35 PM
27037

You might find the attached file helpful

Walentyn
09-01-2020, 02:48 PM
Thanks Paul, yep, that definitely worked, and so much easier than my workaround.

Walentyn
09-01-2020, 03:06 PM
Yes, that's helpful. Thanks for that, as well as all the other tips pages on customising the ribbon. I've used basic buttons to call macros, as well as split buttons and the gallery, and with the option to make some buttons bigger than others, more frequently used macros can be made more prominent. All in all, the result is tidier and takes up less space than the manually configured version.

Paul_Hossler
09-01-2020, 04:14 PM
@Greg --

1. Don't know if it's a font issue, but your 233 shows as a Diamond Question Mark, or FFFD (Alt-x)

0233 Alt-x shows as a y-bar

27038

2. Here's a handy link I keep around

https://ascii.cl/htmlcodes.htm


Oh, BTW, there's a separate Fluent UI forum here, just below the Word forum, where there is a lot of information and is a good place to ask questions

gmaxey
09-02-2020, 08:40 AM
Paul,

I hadn't noticed that. It is supposed to be (and shows in the ribbon if used) as an accented e.

Best Regards,
Greg Maxey

“To know what is right and not do it is the worst cowardice.” ~ Confucius