0
votes

I am building a ribbon tab for MS Excel 2016 from scratch using XML stored within a customUI14.xml file. I created buttons having the "&" special character into the button label (i.e. "Cut & Paste", or "Trades & Models", etc...). The code for inserting the symbol works fine, but I cannot get the labels of the XML controls to display this symbol.

I used both the methods described in the post Inserting symbols into Office Ribbon XML controls but nothing seemed to work.

I'm not state that those approaches don't work at all (I tried with other symbols and they worked - i.e. with the same symbol "€" of the above mentioned post the solution provided in the past post works well)

<menu id="T1G2M1-PGSTRGY" getLabel="RibSetCtlLabel" size="normal" itemSize="normal" 
imageMso="ChartInsertGalleryNew" screentip="Settings &amp; Filters" 
supertip="Options to use during What-If Analysis." getEnabled="RibSetCtlEnabled">

with this call-back procedure

Public Function RibSetCtlLabel(ctl As IRibbonControl, ByRef Label)
  Label = "Settings " & Chr(38) & " Filters"
End Function

Both approaches ("&" symbol directly into the xml text or into the string applyed as result of the call-back procedure) fail tu run properly

I expected to have the button label = "Settings & Filters" but "Settings Filters" is displayed

The workaround solution is required to be run both on x32 and x64 Office 2016 version

2
I could be wrong, but I thought using two in a row worked... like Settings && FiltersbraX
Tks braX... I tried to do that in the screentip string but it doesn't work. It works so only if I use a callback function approach, but I consider this as a workaround because I don't need of a dynamic label for my ribbon buttonJumpy73

2 Answers

0
votes

You need to duplicate a special character in the string to get it visible on the ribbon UI. For example:

Ribbon && Fluent UI
0
votes

In the XML use:

&amp;&amp;