Create a Word Ribbon Tab for Macros in a Startup Template
Question details
Create a custom Word Ribbon tab for macros stored in a template that loads at startup.

- Product
- Microsoft Word 2019
- Device & OS
- not provided
- Scenario
- A user wants macros in Custom.dotm to be accessible from a Ribbon tab whenever Word starts.
- Observed behavior
- The macros are available in Word's Macros dialog, and the user wants a custom Ribbon tab to appear automatically.
Confirm that Custom.dotm loads as a global template when Word starts and that its macros are allowed by your organization's security settings. In Word for Windows, you can check the Startup folder under File > Options > Advanced > General > File Locations.
Add Custom UI XML to the Startup Template
Use this method to store the Ribbon tab in Custom.dotm so it loads with the template.
Word 2019 supports the Office 2010 Custom UI schema, commonly called customUI14; it does not require a new Word 2019-specific naming convention. The Ribbon button calls a VBA callback, which can then run your existing macro.
Close Word, open Custom.dotm in a compatible Office Ribbon editor, and insert an Office 2010 Custom UI part.
In the Office 2010 Custom UI part, add XML like this example: <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <ribbon> <tabs> <tab id="customMacrosTab" label="My Macros"> <group id="customMacrosGroup" label="Commands"> <button id="runMyMacroButton" label="Run My Macro" onAction="RunMyMacro"/> </group> </tab> </tabs> </ribbon> </customUI>
Open Custom.dotm in Word, press Alt+F11 in Word for Windows, and add a public procedure in a standard module: Public Sub RunMyMacro(control As IRibbonControl). Inside it, call your existing no-argument macro, then end the procedure with End Sub. Replace the example names with your own.
Save Custom.dotm in Word's configured Startup folder, restart Word, and select My Macros > Run My Macro to test the button.

Create a Local Ribbon Tab with Word's Settings
Use Word's Ribbon customization tools if you only need the tab on your own installation rather than inside the template.
Edit Word Documents with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for editing Word documents and moving everyday document work between office suites. Use Microsoft Word for the template-specific Ribbon customization described above.

Frequently Asked Questions
Does Word 2019 need a new Custom UI schema for Ribbon tabs?
No. Word 2019 supports the Office 2010 Custom UI schema, commonly called customUI14. In a compatible Ribbon editor, choose the Office 2010 Custom UI part.
Why can I see a macro in the Macros dialog but not on the Ribbon?
Loading a template makes its macros available but does not automatically create a Ribbon tab. Add Custom UI XML to the template or use File > Options > Customize Ribbon in Word for Windows.
Where can I find Word's Startup folder?
In Word for Windows, go to File > Options > Advanced, scroll to General, and select File Locations. Check the Startup entry for the configured folder.
Why does my Ribbon button appear but not run the macro?
Check that the XML onAction value matches a public callback in a standard VBA module and that the callback accepts an IRibbonControl argument. Also check whether your macro security policy permits the template's code.
Can I distribute the tab by sending someone Custom.dotm?
A tab defined in the template's Custom UI XML can load with the template on another Word installation. The recipient must place the template in their configured Startup folder and allow its macros under their security policy.




