|  | 
| 
 | |||||||
|   | 
|  | Thread Tools | Display Modes | 
| 
			 
			#1  
			 
			
			
			
			
		 | ||||
| 
 | ||||
|  Ribbon Customization - Gallery vs ComboBox - built-in control split button - highlighting control 
			
			I have a custom Word Ribbon using a built-in control that doesn't behave the same way as the built-in control. I'm hoping someone might have an idea on how to save an extra click. So the built-in Ribbon button for Highlighting text behaves like a Combobox. If you click on the left, it highlights the text, if you click on the right arrow, it expands to show various colours that can be selected. Also I can double-click the highlighter to have it remain on so I can drag multiple areas on the page and have highlights applied. Simples! I can use the GUI to add the button to another ribbon. Happily this works normally and can be exported to show up as: Code: <mso:gallery idQ="mso:TextHighlightColorPicker" showInRibbon="false" visible="true"/> So, when I create a custom ribbon and add that 'same' code along with the namespace, the Gallery behaviour starts to bite. This means that clicking on the left side expands the colour picker thus requiring another mouse move and a second click that the original control didn't require. Double-click doesn't work either. Bugger! I've tried variations on my ribbon without success. That code at its simplest is: Code: <gallery idMso="TextHighlightColorPicker" showLabel="false" /> 
				__________________ Andrew Lockton Chrysalis Design, Melbourne Australia Last edited by Guessed; 10-28-2025 at 08:12 PM. | 
| 
			 
			#2  
			 
			
			
			
			
		 | |||
| 
 | |||
|   
			
			Not something I've tried before so gave it a whirl. Added the code below to a new template: Code: <customUI  
	xmlns="http://schemas.microsoft.com/office/2009/07/customui" 
    xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui" >
	<ribbon >
		<tabs >
			<tab id="newTab" >
				<group id="newGroup" >
				    <mso:gallery idQ="mso:TextHighlightColorPicker" showInRibbon="false" visible="true"/>
				</group >
			</tab >
		</tabs >
	</ribbon >
</customUI >Screenshot 2025-10-29 122254.png EDIT: It is the parameter "showInRibbon="false" " that creates the error The top half of the button applies the current highlight color, the bottom half displays the standard gallery. Screenshot 2025-10-29 122341.png Double clicking also seems to work, but only after displaying the gallery to set the highlight color. Hope that helps. EDIT 2: Attached template contains my working example. Although a dotm there is no code. Last edited by Italophile; 10-29-2025 at 11:30 AM. Reason: Add example template | 
| 
			 
			#3  
			 
			
			
			
			
		 | |||
| 
 | |||
|   Quote: 
 When I added the code for the tab to one of my custom ribbon templates OfficeRibbonEditor's validate generated: 'mso' is an undeclared prefix. Line 257, position 10. When run in Word, I get a similar error message: The entire customization fails. Then I tried a clean dotx template with your full code. (attached) I get the same error message as you, but the custom tab does not show up so no access to the button/menu. I would be tempted to try writing it in a .dotm with a custom split-button menu and callbacks, but that is a lot more work and would require that the client give macro permission. P.S. Even though this is not vba, it occurs to me that it would probably be better in the vba forum. I can move it if others agree. | 
| 
			 
			#4  
			 
			
			
			
			
		 | |||
| 
 | |||
|   
			
			I then tried the following: Code: <customUI  
    xmlns="http://schemas.microsoft.com/office/2009/07/customui" 
    xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui" >
    <ribbon >
        <tabs >
            <tab id="newTab" label="New Tab">
                <group id="newGroup" label="Highlight">
                    <gallery idMso="TextHighlightColorPicker" showLabel="false" />
                </group >
            </tab >
        </tabs >
    </ribbon >
</customUI >Like your original try, there was no left/right dichotomy; both sides ended up displaying the drop-down gallery. Also tried: Code: <customUI  
    xmlns="http://schemas.microsoft.com/office/2009/07/customui" 
    xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui" >
    <ribbon >
        <tabs >
            <tab id="newTab" label="New Tab">
                <group id="newGroup" >
                    <mso:gallery idQ="mso:TextHighlightColorPicker" 
                        showInRibbon="false" 
                        size="normal"
                        visible="true"/>
                </group >
            </tab >
        </tabs >
    </ribbon >
</customUI >I tried adding the split button control using the UI and ended up with something that worked fine. 00 deleteme 1.png | 
| 
			 
			#5  
			 
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			Thanks for testing this guys. Italophile, I played with your template and didn't see the tab so I customized the code a little bit to get it showing but I still didn't see the behaviour that I was hoping for. At one stage the file opened with double-click working but then I couldn't reproduce that again. Does this version of the customui code work on your machine? Code: <customUI  
	xmlns="http://schemas.microsoft.com/office/2009/07/customui" 
    xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui" >
	<ribbon>
		<tabs>
			<tab id="newTab" label="Hilite Test" keytip="H" insertBeforeMso="TabHome">
				<group id="newGroup" label="Test" >
				    <mso:gallery idQ="mso:TextHighlightColorPicker" showInRibbon="false" visible="true" size="large" />
				</group >
			</tab >
		</tabs>
	</ribbon>
</customUI>
				__________________ Andrew Lockton Chrysalis Design, Melbourne Australia | 
| 
			 
			#6  
			 
			
			
			
			
		 | |||
| 
 | |||
|   Quote: 
 I got it to load when in startup folder. Same error message. Button is not splitbutton. Full size. Would it be sufficient to put it on the QAT? When placed there... 
 The command is "Text Highlighting Color." Last edited by Charles Kenyon; Yesterday at 01:09 AM. | 
| 
			 
			#7  
			 
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			Thanks for the suggestion Charles I hadn't considered adding it to the QAT but the templates do already have a few QAT buttons already so one more would be a subtle alternative that gives easy access to those attentive users. I note that using the double click makes the GUI added versions show the command is active to allow multi-apply. The Ribbon-code added version doesn't show the active indicator. 
				__________________ Andrew Lockton Chrysalis Design, Melbourne Australia | 
| 
			 
			#8  
			 
			
			
			
			
		 | |||
| 
 | |||
|   Quote: 
 I think in my initial testing Word had got itself confused and resurrected the tab that I added via the GUI so that I could examine the RibbonX. Subsequent testing gives the same results as you get. The standard ribbon uses several controls that cannot be implemented via RibbonX, and this is one of those. | 
|   | 
|  | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| AutoTextList field or Building Blocks Gallery Content Control | WordExperto | Word VBA | 4 | 02-02-2024 06:24 AM | 
| How to reset building block gallery content control | ericliu24 | Word VBA | 6 | 04-15-2022 06:16 AM | 
| Reference a Building block gallery control from another Field and insert text using If logic | Flynny | Word VBA | 3 | 07-30-2018 08:34 PM | 
| Gallery Content control and protect document | DarrenOakey | Word | 2 | 08-13-2015 04:56 AM | 
| How-to: Add a quickpart, field or Building Block Gallery Content Control based on a UserForm | HighSierra | Word VBA | 0 | 05-06-2015 08:20 PM |