Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Updating Many Template References.

Updating Many Template References

Written by Allen Wyatt (last updated January 3, 2022)
This tip applies to Word 97, 2000, 2002, and 2003


Over the years Phillip's company has developed thousands and thousands of Word documents. They recently changed their network infrastructure to use different servers and upgraded computers for everyone in Phillip's department. When someone opens one of those pre-existing documents, it looks for a template that existed in the old infrastructure, but is no longer available. This means that the document takes a long time to open, after which point they can change the bad template reference. If Phillip has to open each of the old documents it is going to take days and days to do it, so he wonders if there is any way to change the template references more efficiently, without the need to open each document.

This can be a real bother—there are few things worse (in the office) than staring at a computer screen, waiting for some process to finish. What is happening is that Word thinks your templates are in a particular location, and it asks Windows to go get the template at that location. Windows dutifully tries (and tries and tries) to comply, repeatedly looking for the location. Each attempt times out, and the aggregate time spent in this vain attempt is quite noticeable.

A solution would be to use a macro to load each document in a directory and change the template attached to that document. The following is an example of such a macro:

Sub BatchTemplateChange()
    Dim sPathToTemplates As String
    Dim sPathToDocs As String
    Dim sDoc As String
    Dim dDoc As Document
    Dim sNewTemplate As String
    Dim i As Long

    On Error Resume Next
    Application.ScreenUpdating = False

    sNewTemplate = "normal.dot"         'new template name
    sPathToDocs = Options.DefaultFilePath(wdDocumentsPath) & "\"
    sPathToTemplates = Options.DefaultFilePath(wdUserTemplatesPath) & "\"

    sDoc = Dir(sPathToDocs & "*.doc")

    While Len(sDoc) <> 0
        Set dDoc = Documents.Open(FileName:=sPathToDocs & sDoc)
        dDoc.AttachedTemplate = sPathToTemplates & sNewTemplate
        dDoc.Close wdSaveChanges
        sDoc = Dir
        i = i + 1
    Wend

    Application.ScreenUpdating = True
    MsgBox "Finished: " & i & " documents changed"
End Sub

Note that the macro loads each document in the default document location, but that doesn't necessarily speed up the loading. The benefit of using the macro is that you can start it running and allow it to work while you are away from the computer.

Additional ideas for a programmatic approach can be found at the following sites:

http://support.microsoft.com/kb/830561
http://www.edugeek.net/forums/scripts/35199-vba-script-change-word-document-template-location.html

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11404) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Updating Many Template References.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Changing Page Margins

Part of determining page layout is to specify the size of the margins that surround the text on a page. Word allows you ...

Discover More

Moving Master and Subdocuments

If you need to move master documents or subdocuments from one place to another on your computer, you have to keep in mind ...

Discover More

Turning Off Track Changes without Unsharing

The Track Changes tool in Excel can be helpful, but it can also be aggravating because it doesn't allow you to use it on ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (menu)

Preventing Changes to Styles in Documents

Have you ever created a template only to have the styles within it changed as they were used within a document? Here are ...

Discover More

Continually Saving Normal.dot

If your Normal.dot file is continually saved when you exit Word, even when you haven't made any changes to it, the ...

Discover More

What Changes Did I Make In that Template?

When you make changes that affect a template, Word usually asks you if you want to save those changes when you exit the ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is one less than 9?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.