What happens when I attach a new template to my document? or How do I copy content and settings from a template to a document?

Attaching a new template to a document

When you attach a new template to a Word document, nothing happens.

The new template makes four things available to the document: macros, AutoTexts/Building Blocks, toolbars and keyboard shortcuts.

Every Word document is based on a template, whether you choose a template explicitly or not.

You can attach a new template to a document. To do that:

  • in Word 2003 and earlier versions, click Tools > Templates and Add-ins
  • in Word 2007 and Word 2010, on the Developer tab, click Document Template (if the Developer tab is not displayed, click the round Office button, click Word Options, click Popular, and then on the right of the dialog tick "Show Developer tab in the Ribbon").

However, this may not achieve what you had mind. This page explains what happens when you attach a new template to a Word document.

If you're not 100% sure of the relationship between Word documents and templates, see What is the relationship between a Word document and its template?.

So, what does happen when you attach a new template to a document?

Nothing.

What? Nothing happens?

That's right: nothing happens to the document when you attach a new template (well, the document stores the fact that it is now attached to a new template, but that's it).

The document inherited styles, content and page settings from its parent template when it was first created. You're not creating a new document, so the styles, content and page settings in the newly-attached template will not affect the document at all.

The newly-attached template will sit in the background, and make available the four things that templates make available to documents: macros, AutoTexts/Building blocks, toolbars/UI customization and keyboard shortcuts.

Those four things sit there waiting to be used, but they're made available to the document. They are in the template: they don't reside in the document. So attaching a new template makes them available; it doesn't change the document.

But that's not what I wanted!!!!!!!

If you want to copy material from template to document, read on. There are ways to copy most things from a template to a document.

AutoTexts/Building Blocks

AutoTexts in Word 2003 and earlier

AutoText can only exist in a template. A document cannot hold an AutoText. You can copy AutoTexts between templates using Tools > Templates and Add-ins > Organizer.

Building Blocks in Word 2007 and later

In Word 2007 and Word 2010, AutoTexts were expanded and re-named as Building Blocks. Building Blocks can only exist in a template.

The part of the Organizer that allowed us to copy AutoTexts from one file to another was removed from Word in Word 2007 and has not been reinstated in Word 2010. The only way to copy a Building Block from one file to another is to insert the content of a Building Block into a document, then select the content and re-save it as a new Building Block in the new file.

Macros

You can copy macros to and from documents and templates (although it is generally poor practice in Word to store macros in documents).

In Word 2003 and earlier versions, use the Organizer at Tools > Templates and Add-ins > Organizer.

In Word 2007 and Word 2010, show the Developer tab, and, on the Developer tab, click Document Template. In the Templates and Add-ins dialog, click Organizer.

Or, you can use the Visual Basic Editor to export a module as a .bas file, and then import it.

Note that the Organizer lists whole modules. You can't copy an individual macro (a Sub or a Function) using the Organizer. For that, you have to copy and paste using the Visual Basic Editor.

Toolbars / UI Customizations

Toolbars (Word 2003 and earlier versions)

You can copy toolbars to and from documents and templates using Tools > Templates and Add-ins > Organizer.

If a control (such as a button) on the toolbar called a macro, then copying the toolbar won't copy the macro. You'll have to do that separately.

UI Customizations (including Ribbon customizations) (Word 2007 and Word 2010)

There is no way to copy UI customizations from within Word. In theory, you can unzip a Word file and extract the UI customizations; unzip the destination file; copy the XML into the destination file; and re-zip it. In practice, use the CustomUI Editor.

Keyboard shortcuts

Word provides no in-built way to copy keyboard shortcuts. You can copy keyboard shortcuts using a tool available at the download page on the Word MVPs site.

Content

The easy way to copy content from a template to a document is to use File > New to create a new document from the template, then copy and paste from one document to another.

The slightly harder way is to use File > Open to open the template itself, and then copy and paste from template to document.

Page Settings

There is no simple way to copy page settings from a template to a document. You'll have to do this manually.

Or, you could open the template and record a macro, and then run the macro in your document. For information on how to do that, see Creating a macro with no programming experience using the recorder on the Word MVPs site.

Styles

There are only three ways in which the document and its template can change one another's styles, and they all rely on your doing something:

  • You can change a style in a document's parent template. In the Modify Style dialog box, you tick the Add to Template box.
  • You can copy styles from the document to its template, or vice versa using the Organizer. To get to the Organizer:
    • In Word 2003 and earlier versions, click Tools > Templates and Add‑Ins and then click Organizer
    • In Word 2007 and Word 2010, on the Developer tab, click Document Template and then click Organizer
  • You can update the document with its template's styles. To do that:
    • In Word 2003 and earlier versions: Tools > Templates and Add‑Ins; tick the Automatically Update Document Styles box
    • In Word 2007 and Word 2010: Developer > Document Template; tick the Automatically Update Document Styles box

    Having ticked that box, immediately go back and un-tick that box. Don't leave the box ticked.

None of these methods works reliably for styles involving bullets or numbering. But see How to safely update a document's styles from its template without using the Organizer and how to make the Tools + Templates and Add-ins dialog safe) on the Word MVPs site.

Actually, there is a fourth way to copy styles from a template to a document (or between templates, or between documents). Although it's a bit arcane, it can have its uses.

All AutoTexts and Building Blocks are saved in templates. Oddly, an AutoText or Building Block can hold text in a style that does not exist in its template.

An AutoText or Building Block can hold formatted text. That is, the AutoText or Building Block knows what style(s) have been applied to the text. When you insert an AutoText or Building Block, Word will bring along any required styles, creating new ones in the document if necessary. It works in exactly the same way as copying text: see Why does text change format when I copy it into another document?.

For more information