View Single Post
 
Old 12-16-2023, 12:43 PM
Italophile Italophile is offline Windows 11 Office 2021
Expert
 
Join Date: Mar 2022
Posts: 542
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

The Quick Access Toolbar cannot be shared, so you'll need to add the button to the ribbon by adding some Ribbon UI xml to the template. You'll find some info about doing this on Greg Maxey's website: Customize the Office Ribbon (It doesn't take rocket science)

However, as there are built-in galleries to display the Quick Parts I wouldn't bother trying to re-invent the wheel by writing code to display the entries and add them to the document. Add your texts to the Custom Autotext gallery and then add that control to the ribbon. This has the advantage that entries in the Custom AutoText gallery aren't visible in the standard gallery on the ribbon.

To add the gallery to the ribbon you can use xml like this:
Code:
<customUI 
	xmlns="http://schemas.microsoft.com/office/2009/07/customui">
	<ribbon >
		<tabs >
			<tab id="tabABCTemplate" insertAfterMso="TabHome" label="Your Text Here">        
				<group id="grpABCTemplate" label="Your Text Here" centerVertically="true">
                    <gallery idMso="CustomAutoTextGallery" label="Your Text Here" size="large" />
				</group >
			</tab >
		</tabs >
	</ribbon >
</customUI >
This will result in a new tab being added to the ribbon containing the Custom AutoText gallery.
Attached Images
File Type: png Screenshot 2023-12-17 112539.png (6.3 KB, 23 views)

Last edited by Italophile; 12-17-2023 at 04:27 AM.
Reply With Quote