Consulting

Results 1 to 7 of 7

Thread: Getting ampersand (&) symbol onto a custom ribbon label for a button

  1. #1
    VBAX Regular
    Joined
    Feb 2020
    Location
    Auckland, NZ
    Posts
    16
    Location

    Getting ampersand (&) symbol onto a custom ribbon label for a button

    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?

  2. #2
    VBAX Wizard
    Joined
    Apr 2007
    Posts
    7,479
    Location
    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
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,244
    Location
    Symbols on Ribbon Tabs and Labels.docm

    You might find the attached file helpful
    Greg

    Visit my website: http://gregmaxey.com

  4. #4
    VBAX Regular
    Joined
    Feb 2020
    Location
    Auckland, NZ
    Posts
    16
    Location
    Thanks Paul, yep, that definitely worked, and so much easier than my workaround.

  5. #5
    VBAX Regular
    Joined
    Feb 2020
    Location
    Auckland, NZ
    Posts
    16
    Location
    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.

  6. #6
    VBAX Wizard
    Joined
    Apr 2007
    Posts
    7,479
    Location
    @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

    Capture.JPG

    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
    Last edited by Paul_Hossler; 09-01-2020 at 05:17 PM.
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  7. #7
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,244
    Location
    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
    Greg

    Visit my website: http://gregmaxey.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •