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: Templates and Page Setup.

Templates and Page Setup

Written by Allen Wyatt (last updated October 5, 2019)
This tip applies to Word 97, 2000, 2002, and 2003


Other issues of WordTips have addressed how to use templates. Templates are nothing but special collections of styles, macros, toolbars, and other "goodies" that define your Word environment. You can change how a document looks by simply changing the template attached to the document and then applying styles, as necessary. You change the template attached to a document by using the Templates and Add-ins dialog box. (See Figure 1.) You display this dialog box by choosing Templates and Add-Ins from the Tools menu.

Figure 1. The Templates and Add-ins dialog box.

When you change templates on a document, not everything from the new template is applied to the document. For instance, the page setup for the template is not applied to a document. This can be frustrating, until you realize that applying it could create quite a few problems. Why? Because page setup information, within Word, is a function of sections. This means that you can vary page setup for each section defined in your document. When you attach a new template to a document, how is Word supposed to know which section's page setup should be overwritten? If it applies the page setup from the template to all the sections in the document, then you could lose quite a bit of work.

There is no such problem, however, when you are first creating a document based on a template. In this case, the new document is simply a reflection of the entire template document.

With this understanding, if you still want to apply the page setup information from a template to the current document, you can do it rather easily using a macro. The following macro can serve as your guide:

Sub ApplyTemplatePageSetup()
    Dim Tmpl As String
    Dim CurDoc As Document

    Tmpl = ActiveDocument.AttachedTemplate
    Set CurDoc = ActiveDocument
    Documents.Add Template:=Tmpl

    With CurDoc.PageSetup
        .LineNumbering.Active =
ActiveDocument.PageSetup.LineNumbering.Active
        .Orientation = ActiveDocument.PageSetup.Orientation
        .TopMargin = ActiveDocument.PageSetup.TopMargin
        .BottomMargin = ActiveDocument.PageSetup.BottomMargin
        .LeftMargin = ActiveDocument.PageSetup.LeftMargin
        .RightMargin = ActiveDocument.PageSetup.RightMargin
        .Gutter = ActiveDocument.PageSetup.Gutter
        .HeaderDistance = ActiveDocument.PageSetup.HeaderDistance
        .FooterDistance = ActiveDocument.PageSetup.FooterDistance
        .PageWidth = ActiveDocument.PageSetup.PageWidth
        .PageHeight = ActiveDocument.PageSetup.PageHeight
        .FirstPageTray = ActiveDocument.PageSetup.FirstPageTray
        .OtherPagesTray = ActiveDocument.PageSetup.OtherPagesTray
        .OddAndEvenPagesHeaderFooter =
ActiveDocument.PageSetup.OddAndEvenPagesHeaderFooter
        .DifferentFirstPageHeaderFooter =
ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter
        .SuppressEndnotes = ActiveDocument.PageSetup.SuppressEndnotes
        .MirrorMargins = ActiveDocument.PageSetup.MirrorMargins
    End With
    ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges

    Set CurDoc = Nothing
End Sub

This macro determines the template in use, creates a new document based on that template, and then copies the page setup information from the new document to the original one. When completed, the new document created by the macro is deleted. You can delete any portions of the macro that you don't feel are applicable. For instance, if you only wanted to change the margins to match your template, all you need to keep in this macro are the four lines that set the margins.

Obviously, this macro overrides any page setup information in your document. (This is the original idea, right?)

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 (1815) 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: Templates and Page Setup.

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

Printing Reports

The Report Manager allows you to create specialized reports that can be easily printed from your worksheet data. This tip ...

Discover More

Prohibiting Single-Digit Entries in a Cell

The Data Validation capabilities of Excel can be very helpful when you are trying to control what people can enter into a ...

Discover More

Controlling AutoComplete for Month Names

Word has a feature called AutoComplete which is helpful when typing some comment things, such as month names. This tip ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (menu)

Protect Your Document Templates

If you want to protect your templates from accidental changes, the best way to do so is by using Windows instead of Word. ...

Discover More

Managing Corporate Templates

Templates are used to store styles and lots of other customizations that affect how you use Word. On a single-user ...

Discover More

How Word Treats Normal.dot

Templates are at the core of how Word creates and formats documents. From the earliest days of Word, the most basic of ...

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 8 - 5?

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.