paper-resized-360x450.jpg
In a previous post we saved a custom macro-filled template in the Word’s Start-up folder so that the template would be automatically installed whenever Word is opened.  This makes the macros and shortcuts saved in the template available for use.
Another option is to save the template outside of the Start-up folder and install the template just when we need to.  In this post we will record a couple macros to install and uninstall our custom template.
Note that we describe this as ‘installing’ the template not ‘opening’ it.    You can open the template directly whenever you want to make changes to the macros or shortcuts.  
But you don’t have to open it to use the macros and shortcut.  Instead, you can ‘install’ the template which makes it’s macros and shortcuts available to all the documents you open and create.
First, let’s start the ‘Macro Recorder.’  Lets name the macro ‘InstallCustomTemplate’:
Record Macro 'InstallCustomTemplate'
(Note, we are saving this macro in the ‘Normal.dotm’ template.)
Go to File/Options/Addins.  Select ‘Templates’ from the ‘Manage’ drop-down and click the ‘Go’ button.
File - Options - Addins - Manage Templates
Click the ‘Add…’ button and browse to find your custom template.  It will appear on the list with a check box checked.
Add custom template as a Global Template
Click ‘OK’ and stop the macro recorder.  Here is the ‘InstallCustomTemplate’ macro:
View code to install a custom template
The important line of code is this (replace ‘…file path…’with the path name of your template.)
AddIns.Add FileName:=”… file path … My Custom Macros.dotm”,  Install:=True
To create the ‘UninstallCustomTemplate’ start the Macro Recorder again and follow the same steps as above.  When you get to the templates dialog box, simply uncheck the box for ‘My Custom Macros.dotm.”
Uninstall 'My Custom Macros' template
Here is the recorded macro:
code to uninstall a custom template
Here is the line of code:
AddIns(“… file path … My Custom Macros.dotm”).Installed = False
You can now create shortcut keys or quick access buttons  if you choose.   See the post on creating shortcuts for more information.
 

Recent Articles