Office Settings & Configuration

Create a Word Ribbon Tab for Macros in a Startup Template

Chanuka GeekiyanageChanuka Geekiyanage Nov 13, 2026 869 views

Question details

Create a custom Word Ribbon tab for macros stored in a template that loads at startup.

Create a Word Ribbon Tab for Macros in a Startup Template
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the template in a Ribbon editor

Close Word, open Custom.dotm in a compatible Office Ribbon editor, and insert an Office 2010 Custom UI part.

2
Add the Ribbon markup

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>

3
Create the VBA callback

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.

4
Load and test the template

Save Custom.dotm in Word's configured Startup folder, restart Word, and select My Macros > Run My Macro to test the button.

Add Custom UI XML to the Startup Template
Macro security still applies: Loading a template from Startup does not guarantee that its macros will run. Follow your organization's trusted location or macro-signing policy, and verify that the callback name matches the XML onAction value.
Free Microsoft Office alternative

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.

Edit documents in a familiar word-processing interfaceOpen and save common Microsoft Word formats, including DOC and DOCXUse a lightweight office suite for everyday document workMove compatible documents between WPS Writer and Microsoft Word
microsoft office alternative - wps office

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.