Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 12-16-2023, 12:43 PM
Italophile Italophile is offline VBA code for loading autotext using userform and commandbutton Windows 11 VBA code for loading autotext using userform and commandbutton 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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform selectbox to insert autotext aee74 Word VBA 8 02-10-2019 03:39 AM
VBA code for loading autotext using userform and commandbutton Recording code to create Autotext entries emblackett Word VBA 2 09-25-2017 02:00 AM
VBA code for loading autotext using userform and commandbutton Creating a (shared!) file with CommandButton placing AutoText into the document thmsrox Word VBA 5 07-07-2016 05:04 AM
UserForm of Autotext Entries ptmuldoon Word VBA 11 02-13-2016 09:36 AM
VBA Code in a UserForm module to delete a Command Button which opens the userform Simoninparis Word VBA 2 09-21-2014 03:50 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft