Word2007.Tips.Net Welcome toWord2007.Tips.Net

Helpful Links

Word 2007 Home
Tips.Net Home

Ask a Question
Make a Comment

Cleaning Tips
Health Tips
Money Tips
Word2007 Tips

Newest Tips

Hanging Indents

Getting Around How Word Sorts Text

Getting Rid of MRU Entries

What is an MRU File?

Formatting Multiple Documents

Inserting a Dynamic Word Count in Your Document

Turning Off Automatic Indenting

 

Formatting Multiple Documents

Summary: Need to format a bunch of documents so they all look the same? If the documents use styles, doing the formatting is relatively easy, as described in this tip.

If you routinely receive documents from different people, you may be wondering if there is a way to format the documents so they all look the same. It can be frustrating to work with documents where everyone has a different idea of what looks "good" on a printed page.

The tried-and-true method of standardizing the formatting of information in a document is to simply use styles. If you define a set of styles that cover all your formatting needs, you can then store these in a template that can be easily applied to a multitude of documents. You then attach the template to a document by following these steps:

  1. Display the Developer tab of the ribbon and then click on the Document Template tool. Word displays the Templates and Add-Ins dialog box. (Click here to see a related figure.)
  2. Click on the Attach button. Word displays the Attach Template dialog box, which looks very much like a standard Open dialog box.
  3. Use the controls in the dialog box to locate and select the template you want attached to your document.
  4. Click on Open. The Attach Template dialog box disappears and the name of the template you selected appears in the Document Template box.
  5. Select the Automatically Update Document Styles check box to make sure that the styles in the template are applied to your document.
  6. Click on OK.

If you don't see the Developer tab necessary for step 1, then you need to make the tab visible. You do that by clicking the Office button and then clicking the Word Options button. In the resulting Word Options dialog box, the Popular option should be selected at the left. Make sure the Show Developer Tab in Ribbon check box is selected and click OK.

These six simple steps apply the formatting in the template to the open document. What does this mean? It means that the appearance of anything formatted with styles in the current document will be updated to reflect styles with the same names in the template. For instance, if there is a Body Text format in both the document and the template, the style definitions in the template will override those in the document, thereby standardizing the appearance of the document.

There are a couple of big caveats to this, of course. If the document does not utilize styles, or if the character formatting in the document has been explicitly overridden (in other words, the user selected text and used the Font dialog box, toolbars, or ribbons to format text), then attaching the template to the document will have no appreciable effect on the text. You will still need to go through the document and manually apply the styles from the newly attached template.

The other thing that is not updated when you attach a new template is information contained in the Page Setup dialog box. Thus, things like paper size, margins, header and footer locations, and orientation are not affected. These need to be either updated manually on a document-by-document basis, or done as a whole through the use of a macro. The framework for such a macro is as follows:

Sub MassFormatFiles
    Dim JName As String

    Dialogs(wdDialogFileOpen).Show
    Application.ScreenUpdating = False
    JName = Dir("*.doc")
    While (JName > "")
        Application.Documents.Open FileName:=JName

            'Do formatting here

        ActiveDocument.Close SaveChanges:=wdSaveChanges
        JName = Dir()
    Wend
    Application.ScreenUpdating = True
End Sub

Remember that is only a framework. To use the macro, you need to replace the "Do formatting here" comment with the actual commands that do the formatting you want done to each file. You can copy these commands from a macro where you recorded the formatting steps, if desired.

When you run the macro, you will see a regular Open dialog box. All you need to do is display the folder whose files you want to process, and then click on Open. Each file is opened in turn, formatted (with your supplied formatting commands) and then saved again.

You should understand that any time you attempt to do any "mass formatting" across documents, you run the risk of messing the documents up in some unforeseen way. Why? Because there may be some relatively small but important difference in between documents that gets clumsily messed up by being overridden when applying the common formats. No amount of automatic formatting will compensate for manually looking through each page of a document to assure that everything appears as it should.

Related Tips:

Save Time! WordTips has been published weekly since early 1997. Past issues are available in convenient WordTips archives. Have your own enhanced archive of WordTips at your fingertips, available to use at any time! Check out WordTips Archives today!