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: Merging to Individual Files.

Merging to Individual Files

Written by Allen Wyatt (last updated March 4, 2023)
This tip applies to Word 97, 2000, 2002, and 2003


When you use the mail-merge feature in Word, you have the option of either printing your results directly or creating a new document. If you choose the latter option, the resulting document contains all the information that normally would have gone to the printer. For instance, if your merge document is a two-page letter, each letter in the resulting document is separated by a section break. Thus, if you are merging the two-page letter with 150 different addresses, then you would end up with a 300-page document with 150 section breaks (one every two pages).

For some people, it would be more helpful if you could merge to individual files. For instance, given the above example you might want 150 individual document files, each two pages long. Unfortunately, that is not one of the options available when using Word's mail-merge feature. The only answer to accomplishing this task is to create a macro that will, based on the merged document (the 300-page one mentioned above) take each section and save it to its own document file.

If you look in Microsoft's Knowledge Base, you will find that there is an old article that deals with this very issue:

http://support.microsoft.com/kb/216201

The macro presented in the article, even though it was written for an older version of Word, will work just fine in later versions. It allows you to separate a merged document into individual files, based on the section breaks:

Sub BreakOnSection()
    'Used to set criteria for moving through the document by section.
    Application.Browser.Target = wdBrowseSection

    'A mailmerge document ends with a section break next page.
    'Subtracting one from the section count stop error message.
    For i = 1 To ((ActiveDocument.Sections.Count) - 1)

        'Select and copy the section text to the clipboard
        ActiveDocument.Bookmarks("\Section").Range.Copy

        'Create a new document to paste text from clipboard.
        Documents.Add
        Selection.Paste

        'Removes the break that is copied at the end of the section, if any.
        Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtend
        Selection.Delete Unit:=wdCharacter, Count:=1

        ChangeFileOpenDirectory "C:\"
        DocNum = DocNum + 1
        ActiveDocument.SaveAs FileName:="test_" & DocNum & ".doc"
        ActiveDocument.Close
        'Move the selection to the next section in the document
        Application.Browser.Next
    Next i
    ActiveDocument.Close savechanges:=wdDoNotSaveChanges
End Sub

It is important to realize, however, that this macro will only work if the only place that section breaks occur is between merged documents. If your original document includes section breaks, then the macro will not provide satisfactory results. For additional information on using the macro, refer to the Knowledge Base article at the link provided above.

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 (1538) 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: Merging to Individual Files.

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

Splitting Text to Multiple Cells

When processing data, you may have a need to split a long text string into shorter chunks of text consisting of whole ...

Discover More

Incrementing Numeric Portions of Serial Numbers

If you use serial numbers that include both letters and numbers, you might wonder how you can increment the numeric ...

Discover More

Counting Ports of Call with a PivotTable

A PivotTable is a great way to aggregate and analyze data. Sometimes, though, it can be difficult to figure out how to ...

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)

Inserting a File

Need to combine several files into a single document? You can do it by inserting one file into another, as outlined in ...

Discover More

Saving Everything

Need to force users to save their work? It may be as simple as implementing a couple of macros that get a bit more ...

Discover More

Size Limit for Documents

Word can handle large documents, but how large is large? This tip examines the issue and provides some advice on how ...

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 2 + 8?

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.