Running a Macro from a Toolbar

Write or Record the Macro

Any macros that you want to be accessible from any documents should be saved into your template.
The is your global template and is always open when Word is open meaning that the macros are available when any document is open.
If you are recording a macro the "Save in" drop-down box will default to unless you have another template or add-in open.
If the active document is attached to a different template (i.e. not you can use the drop-down to select this template. This will allow you to make customisations specific to the documents based on that template.

Display the Customise dialog box

Before you do that make sure that the toolbar you want to add the button to is visible.
Select (View > Toolbars > Customise) or alternatively select (Tools > Customise).
Select the Commands tab. Scroll to the bottom of the Categories list and select "Macros".
In the Commands list box, will be a list of all the macros that are available in the current template.

microsoft excel docs

This tells us that we have one macro available in the template called "BoldSelectedText".

Add the additional Toolbar button

To add this button to an existing toolbar you need to drag the button and release it on the desired toolbar.
You will see a black line appear indicating where the button will appear if you release the mouse button.


If you want to save the changes in a Word add-in then you need to open the add-in as a document first.

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext