To move your macros (and other customizations) to a another template or
system...
This page was last changed on
Monday 11 November 2024
.
Contents
Customizations in Word - Background
Start by opening the target template
| Creating a new (global) template |
Copying Customizations to your global template
Copy your macros
Copy your toolbars
| How to create copyable customizations to the built-in menus and
toolbars |
| How to copy UserForms |
Copy keybindings
Making your template a global template
Copy your styles
Copying Customizations not stored in templates
Customizations in Word - Background
The customizations that you can make in Word include:
- Macros - recorded or written using VBA - these are kept in templates
(default Normal.dot(m)) or documents. Unless you have a definite reason and
know what you are doing, keep them in templates.
- AutoText entries - also kept in templates (default Normal.dot(m)). AutoText
entries cannot be stored in documents. For more on AutoText, follow the
links on the Web
Resources page.
- Custom toolbars and menus - also kept in templates (default
Normal.dot(m)) or
documents. As with macros, you will want to keep toolbars in templates with
rare exceptions. You make these with Tools => Customize... or with VBA.
Custom toolbars and menus are not used in ribbon versions of Word, instead
there is ribbon and QAT customization.
See
Modifying the QAT and Ribbon in Microsoft Word for ideas on flexible
solutions.
- Custom toolbar buttons and menu commands - really a subset of custom
toolbars except includes customizations to built-in toolbars and menus.
- Styles - also kept in templates except that after creation documents have
their own styles which are generally not updated by the styles in the
document's underlying template. See
Understanding
Styles for more about styles. See Global StyleSheet in Microsoft Word?
for a macro that will transfer styles from a global template to the current
document.
- UserForms - homemade dialog boxes and wizards
- Keyboard shortcuts (also called keybindings) are stored in templates or
documents.
- AutoCorrect entries - for the most part stored in separate files and very
different from AutoText in construction if not in use.
- Your user preferences - stored in the registry's
Word data key. We won't mess with the registry here.
- See
Word 2007 & Later Key Data File Locations by Paul Edstein for exact
storage locations of preferences and options in Word 2007 or later. (Many
are the same for earlier versions, there are just more options and features
in the later versions.)
- Word 2007 and later:
- Building Blocks (including AutoText) - stored in templates. See
Building Blocks & AutoText and
Where can Building Blocks be stored?
- Quick Access Toolbar (QAT) modifications - stored in templates or in a
special file.
- Ribbon Modifications (If done through XML modification, stored in
templates, otherwise in a special file.)
See
Modifying the QAT and Ribbon in
Microsoft Word
We will first look at the customizations that are stored in templates and
copying/moving them to a different template. That is: Macros, AutoText, Custom
Toolbars, Keybindings and Styles. We will then look at those stored
elsewhere:
AutoCorrect Entries and user preferences.
A brief note about Word 2007-2024 (365). "If you have custom templates that rely heavily upon
carefully crafted custom toolbars and menus, there's good news and bad news
and good news. The good news is that some of those toolbars might actually
still work in Word 2010 [2007-2024] if you upgraded from Word 2003. Look for them in the
Add-Ins ribbon. The bad news is that Word 2010 [2007-2016] no longer contains
customization tools that let you create and modify multiple toolbars. The
good news, however, is that in Word 2010 you can customize the ribbon."
Microsoft Word 2010 Bible by Herb Tyson,
MVP
See Modifying the QAT and Ribbon in
Microsoft Word for ideas on more flexible solutions.
Start by opening the target template or a document based on the target template.
I would suggest that you move the items you want to share into a global
template. The simplest way is to open the template or create a new document
based on the template. You will want to use a document template instead if
the customizations only are used in a specific kind of document that will have
its own document template. For an explanation of the distinction being made
between document templates and global templates, see Templates
in Microsoft Word.
Create a new (global) template
If you don't already have a global
template that you'll be using, go to
File => New and click the dot for Create New "Template" in the bottom right corner
of the dialog box.* Select the blank document template if it isn't already
selected. Click on the OK button. You can use this new template to keep
notes on what you have done if you want. Save it using a name like "MyGlobal.dot."
Don't close it yet because you'll be using it to hold many of your
customizations.
* In Word 2002 and later you'll need to click on the general templates / on my
computer line of
the New File Task Pane to get this dialog box.
Instructions on using this new template as
a "global" template are given further down in this article.
Copy Template-Resident Customizations
(Word 2003 and earlier): Tools => Templates and Add-Ins... => Organizer (button) => Macro
Project Items (tab) to copy a macro module.
(Word 2007 and later): View => Macros => Organizer (button) => Macro
Project Items (tab) to copy a macro module.
If you just created a new template and have that open, no macros will be
shown in the window on the left - the one for your current document / template.
Probably the macros will be in the Macro Module "New Macros." in the
Normal.dot(m) template (shown in the window on the right). If you already have a Module named "New Macros" in your
template, rename it "OldMacros" for now so you can copy the Module from
Normal.dot(m) to your
template. If there are other modules in Normal.dot(m) you want to copy those as
well.
Then close the Organizer and save your template. Don't close the template,
yet.
Use the VBA Editor (Alt+F11) to look at the New Macros module in your
template (not the one in the Normal.dot(m) template). You should be able to spot the macros that
you use. Delete any other macros and Ctrl+S to save your changes to the
Template. If you already had macros in your template and had to rename "New
Macros," double-click on that "OldMacros" module. For now, you will want to move all
the macros to your new "New Macros" module. Then right-click on the
"OldMacros" Module and remove it. Word will ask you if
you want to export first; answer: No. With your insertion point back in the New
Macros module of your template, press Ctrl+S to again save your template.
You can and should have modules other than NewMacros, which is the
location in which recorded macros are stored. Once you have recorded a
macro, you can cut it and paste in a new module.
Right-click on one of the toolbars in the Visual Basic Editor and select
the Edit toolbar for display. Then double click on the Module "New Macros" in
Normal.dot(m) select the m acros that you transferred to your template.
Click
on the "Comment Out" button to make them inactive in
Normal.dot(m). This put's an apostrophe at the beginning of each line that you've
selected. (You will want to delete them evenutually, but not until after your
global template is active.) Ctrl+S to save your
changes to Normal.dot(m).
If you have macros that are called by toolbar buttons or keybindings, the
macros must be in place before you move these customizations. They must have the
same name and be in a module with the same name in a project with the same name
that they were in before. i.e., the macro named MyMacro that is in a
module named TrustedMacros in project named TemplateProject, will not work with
a moved toolbar or keybinding unless it, and the project and module keep the
same names they had when the toolbar/keybinding was created. They will run just
fine if you give them new names, but your toolbars and keybindings won't be able
to find them.
Save your global template.
Copy your toolbars (Word 2003 and earlier)
If you have toolbars that you want to move, copy those as well, after you
have copied any macros, styles, or AutoText that the toolbars call. Again, Styles won't do you much good in
a global template. (Don't have customized toolbars but you would like to
try these? See Greg Chapman's page
on this.)
Save and close your global template. If this is a new template, close Word
and move the global template to your Word Startup folder.
Open a new blank document. Tools => Customize => Toolbars (1st Tab) and
check your custom toolbars. Right-click on the selection and rename it xxx Old
Toolbar. (We are doing this before deleting it. Want to check if new toolbar
works and can't really do that without changing the name.) Close the Customize
dialog box.
Create a new document from your template. File => New... Check to see if
your toolbars and macros function the way you want them to. Type something in
the document and then close it without saving it. You should be prompted as to
whether your want to save the changes made to MyGlobal.dot. Answer
"Yes."
Assuming that your toolbars and macros function properly, you can now use
Tools => Customize (this time customizing Normal.dot(m)) to delete "Anne's
Old Toolbar." Quit Word and save your changes to Normal.dot(m).
Next time, when you create a toolbar using the Customize command under the
Tools menu, or Tools = Macros... to record a macro, check to make sure that it
is being saved in the template that will be using it rather than in Normal.dot(m).
Likewise, make sure that any changes you make to that toolbar or macro get saved
in the template.
This way, if you pass your template on to someone else, they will have the
benefit of your toolbar and macros. Also, Normal.dot(m) corrupts from time to time
(even without the assistance of a virus). Rebuilding your customizations can be
a real pain.
How to create copyable customizations to the
built-in toolbars and menus (Word 2003 and earlier):
Organizer will not copy customizations to built-in toolbars and menus, so you
have to work around this limitation. You cannot copy customizations made
directly to these toolbars or menus. The way I have used is:
I create a shadow toolbar in my global template to hold my customizations. It
has a custom menu for each built-in menu or toolbar that I customize.
MyFile MyEdit MyView MyFormat, etc.
I use a separate shadow toolbar for the shortcut menus but you could put them
all on one if you wanted to, it depends on how many customizations you do. I
include a custom menu named Chas that has some of my favorite templates and
commands. That menu is one of the main customizations of my global template and
I want to be able to back it up or move it. It was designed to go on the main
menu bar, but if I created it there (as I did at first) I would not be able to
copy it.
I put the customizations on those custom menus on this custom toolbar first.
That means using Customize to add the commands. Then, once I've added a command
to the custom toolbar, I Ctrl+drag it to the built-in.
You can use custom menus as a submenus to hold the deleted items, the
simplest way to do this would be to move the items from the File menu to the
MyFile => Deleted Items submenu and so forth.
This isn't perfect but it makes rebuilding the customizations to the
built-ins a lot less painful because the custom toolbar can be copied to another
template using the organizer.
See also
Creating Custom Toolbars for Templates
Note - toolbars from earlier versions become limited in Word 2007 and later versions - appearing
only on the Add-Ins tab.
Ribbon and QAT modifications to individual templates move with the template
and are available to other documents in the same way that macros stored in a
template are available to other documents. Those in the attached document
template are available to those documents to which the template is attached;
those in global templates are available in all documents or templates on that
computer. See Modifying the QAT and Ribbon in
Microsoft Word for ideas on more flexible solutions.
If you don't know what a userform is, chances are real good that you don't
have any that you have written. It is a VBA construct - a homemade dialog box or
wizard, not a piece of paper that you fill out, or an online simulation of this.
If you have created and are using userforms, you probably don't need this
tutorial and certainly don't need explicit instructions, so: Within the Visual
Basic Editor either drag the userforms from one project to another or export the
form from one project and import it into another.
Userforms can be very simple or elegantly complex. If you are doing VBA
programming and not using them because you don't know how, take a look into the
tutorials on the
MVP
website.
How to copy/move Keybindings (Custom Keyboard
Shortcuts):
These are the custom key assignments made to macros and commands. I use Chris
Woodman's Add-In ShortCut Organizer, which looks and works like the regular
Organizer except that it deals with keyboard shortcuts.
The above screenshot is from Word 2010. I know this works also in Word
2013-21 (365). This is 2002 software but is the only way I know to copy keybindings. The Add-In will also copy document variables. Go to my
downloads page to download either the original Add-In or a modified
version that adds Ribbon buttons.
Making your template into a global template
A global template is stored in the Word Startup folder.
What will make your template a global template is the folder in which you store it.
Global templates should be stored in the Word Startup folder (which is not
in any of your templates folders). You can find the location of your Word
Startup folder using Tools => Options => File Locations (tab). Save your
template there. If you want, you can keep your template somewhere else. If you
do, you will want a shortcut to it stored in your Startup folder. See
Template
Basics for information on different types of templates.
You can share your
template with one or two others by sending it to them (by email or on
removable media like a diskette, recordable CD/DVD or flash drive) along with instructions for them to place it in their Word startup
directories. Note, though, do not use Word to save your template to
removable media
and be sure to instruct anyone that you send it to on removable media to copy it to
the hard drive using Explorer before using it. Word doesn't work with
removable media well. You need to use Windows to move the file both to and
from the hard drive. Only work with documents on a hard drive from Word.
If you set your macro security to "Trust All Installed Templates
and Add-Ins" you will not get macro warnings for macros in templates that
are stored in the Word startup folder. (This is also true of the User
Templates folder and the Workgroup Templates folder.)
Note that beginning with Office 2000 there is also an Office
Startup folder. Many add-ins, including commercial ones, are
mistakenly installed there. While they can run from there, they will trigger
macro warnings or be disabled by macro security because this is not a
"trusted location." This will annoy or disappoint your users. Don't put your
Word global templates there.
Finally, do not store Normal.dot(m) in the Startup folder. You will confuse
Word which will retaliate by sending you confusing error messages.
Sharing your custom global template with others on your network.
You can share your global template (and the non-style customizations that
it contains) with others on your network by saving it in a network folder that
others can read. The network login script for each user should be set to copy
files in that folder to the user's own Word startup folder. How this works depends
entirely on your network setup. Talk to your local area network supervisor
about it. Normal.dot (Normal.dotm) should never be a shared file.
For more on this, see
Distributing
Macros to Other Users by Jonathon West on the MVP site.
Do not attempt to share QAT or Ribbon modifications created from within
Word with other users. Doing so will erase any customizations they have made
to their Word installation. See Modifying
the QAT and Ribbon in Microsoft Word for ideas on more flexible
solutions.
Use the Organizer:
(Tools => Templates and Add-Ins... => Organizer (button) =>
Styles (tab)) to copy your styles to a document or document template. I
recommend making the copies three times. That is: Copy all of the
styles you are going to copy once. Then copy all of them again, then copy them
all yet a third time. This is so any styles based on
other styles will "take." Failure to do this may mean that your
styles don't transfer properly. If any of your macros apply your styles, you
should copy the styles before the macros.
Styles are in some ways the hardest customizations to share. That is because a global template containing them doesn't make any difference.
(You can still copy them to your global template if you wish.)
Available styles are contained in:
| the document |
| the attached template (if not used in the document) and |
| Normal.dot(m) (if not used in the document or the attached template) (Normal.dot(m) may be the attached template). |
Once a style is used in a document (even if the use is deleted) it lives there and changes to the attached template will usually not change the style in the document. Changing it in the document usually won't change it in the attached template. See
Understanding Styles for more on styles. That
chapter includes instructions on copying styles from one document / template to another.
Putting a template containing your styles in the workgroup templates folder is a good way to share styles. See
Template Basics for more on templates and templates folders.
You can construct a global template with macros and toolbars that copy styles
from the global template to a target document but that is beyond the scope of
this web page. See Global StyleSheet in Microsoft Word?
for instructions on how to do that. See Templates Menu for
information on how to construct a custom toolbar to use macros.
Copying Customizations not stored in templates
How to copy/move AutoCorrect entries
AutoCorrect entries are stored in *.acl files and in Normal.dot(m). The
*.acl files are language-specific. Utilities for Ribbon versions of Word may be found at
Greg Maxey's
AutoCorrect Utility Manager and as AutoCorrect2007.zip on Jay Freedman's
site: The Macro Zone. For non-ribbon
versions, you can use the macro you can find at How
can I import and export all my AutoCorrect entries, so they can be transferred
to another machine? There is a macro included with Word that is supposed to
do this, but it has several bugs that are fixed in this one available on the
MVP website.
How to copy/backup user preferences that are stored in the Registry's Data
Key.
This requires a simple macro, which you can record! Start up Word for a
fresh session and record a macro called "MyUserSettings." The action
to record is opening the Tools => Options dialog box and clicking on
the tab for every page on that box. Then close that dialog and open the Tools
=> AutoCorrect dialog and do the same thing - click on each tab and
then close the dialog box. This is based on instructions by Beth Melton in the
article
What
exactly does the Data Key in the Registry store. I also include the
Customize dialog box and Keyboard button from that box in this but am unsure
that it actually helps. Stop recording. You now have one method to return to
these settings: Just run the macro. Unfortunately, this won't save all of your
user preferences, just a lot of them!
To save all of them, you can use ResEdit (Start => Run => ResEdit).
Do not change anything in the Registry without (1) making a backup, and (2)
having a good idea what you are doing! That is not for the faint-at-heart! I
am suggesting making a specific backup of the Data Key for Word. The article
by Beth Melton explains how to find the Data Key. If you right-click on it you
can export it (make a copy) of your Word settings. This is a good idea because
the Data Key seems to be easily corrupted. Doing this will not make any
changes to the registry itself.
How to copy / backup custom dictionaries and exclude files.
Where these are stored depends on both your version of Word and your
operating system. You can find the location using your menus to create a new
dictionary (without creating one).
Tools => Options => Spelling and Grammar =>
Dictionaries => New
The default custom dictionary is named custom.dic. The exclude
dictionary's name will depend on your language settings. See
How to “remove”
a word from Word's main Spelling Dictionary for more on the exclude
dictionaries.
How to copy / backup Ribbon and QAT modifications
Word 2007 does not provide any means within the user interface (from
Word) to modify the Ribbon.
Word 2010 - 2016 do provide limited ability to do this.
Modifications done through the interface can be exported and imported, but
only as a whole, overwriting any existing modifications upon an import.
Modifications to the Quick Action Toolbar (QAT) are stored in either a separate
file or in a template or document.
Modifications to the Ribbon from within Word (2010-2016) are stored in separate
files.
See Modifying the QAT and Ribbon in
Microsoft Word for information on the names and locations of the files
holding QAT and Ribbon modifications that you created within Word as well as
suggestions for more flexible handling of such modifications.
See Template Basics for more on
templates (user and workgroup), global templates and Normal.dot(m).
See also Assigning
Custom Button Faces to Your Toolbar and Menu Buttons.
See Distributing
Your Macros to Other Users by Jonathon West, MVP.
For more on where customizations are stored see
What Files Do I Need to Backup? by David Rado and Brenda Hutton and
Word 2007 & Later Key Data File Locations by Paul Edstein.
since 14 April 2006
|