Word.Tips.Net WordTips (Menu Interface)

Changing Information in Multiple Documents

As you use Word, day in and day out, you tend to accumulate lots and lots of documents. If these documents are used for a standard purpose, it is not unusual for the documents to contain some of the same information.

For instance, you may have documents that contain stories that you submit to different newspapers and magazines. While the individual stories may be different, each document may contain your name and contact information. If your contact information changes, or if you decide to use a different spelling for your name, you may long for a way to do a universal change to all the documents at once.

Unfortunately, Word does not include this type of capability. Your options are either to rely on a third-party solution or write your own macro to do the changes. There are a number of third-party programs that offer the type of search-and-replace function necessary when working with multiple documents. The following are just a few of the ones suggested by WordTips subscribers:

Word developer Malcom Smith has also created a macro that will perform search and replaces across directories. If you want to see it, you can visit http://www.dragondrop.com. Just click the Find and Replace for Word link, at the right side of the page.

If you don't mind using your own macros, the following shows the techniques inherent in stepping through the documents in a particular folder.

Public Sub MassReplace()
    With Application.FileSearch
        .LookIn = "C:\"             ' where to search
        .SearchSubFolders = True    ' search the subfolders
        .FileName = "*.doc"         ' file pattern to match

        ' if more than one match, execute the following code
        If .Execute() > 0 Then
            ' for each file you find, run this loop
            For i = 1 To .FoundFiles.Count
                ' open the file based on its index position
                Documents.Open FileName:=.FoundFiles(i)

                ' search and replace the address
                With selection.Find
                    .Text = "OldAddress"
                    .MatchCase = True
                    .Replacement.Text = "NewAddress"
                End With
                selection.Find.Execute Replace:=wdReplaceAll

                ' replace e-mail address
                With selection.Find
                    .Text = "Oldemail"
                    .Replacement.Text = "Newemail"
                End With
                selection.Find.Execute Replace:=wdReplaceAll

                ' save and close the current document
                ActiveDocument.Close wdSaveChanges
            Next i
            ' if the system cannot find any files
            ' with the .doc extension
            MsgBox "No files found."
        End If
    End With
End Sub

This macro is quite powerful, and it allows you to not just change a street address, but also your e-mail address. All you need to do is make changes to specify which directory and drive to use in your search, as well as what the old and new information is. Change the .Lookin parameter early in the macro to indicate where the macro should search; make sure you use a full path. Then, within the main body of the macro, update the .Text and .Replacement.Text parameters to reflect what you are searching for and replacing with.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (3783) applies to Microsoft Word 97, 2000, 2002, and 2003.

Related Tips:

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!


Leave your own comment:

  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*What is 4+5 (To prevent automated submissions and spam.)
          Commenting Terms

Comments for this tip:

Sharon    17 Jul 2015, 00:10

Here's the correct Wordfisher link:
It only works up to Word 2003, however.

InfoRapid cannot replace text in Word docs, just find.

Malcolm Smith's macro is gone as is the whole website apart from the landing page.

The rest are all paid commercial software.
sid    20 May 2015, 03:28
user can use a software for find and change word in several word document.
ben    28 Mar 2015, 04:29
is it possible to run the code from a add-in inside word it self? - for a multiple docs.
Carol    16 Mar 2015, 07:59
I need to 'find and replace' multiple words in a Word doc. I type the same words over and over, so to save time, and my fingers, I'd like to have a list of words, for example, pp for people, "a" for and, "sat" for satisfactory, etc. So I type those short forms and at the end, I want to replace each one with the proper word. But not one by one, all of them.

Anyone got any ideas?

G Prasanth Kumar    12 Mar 2015, 09:21
This information helps a lot.

Apart from this I am looking the possibilities to do changes to a word file with dotm extension, and save it as docx file in Ubuntu through a cronjob.

Is there any option to do this?
sukesh    19 Feb 2015, 12:08
if we have to open one word file we have to copy the that matter in another word file .if we modify the first word file automatically modify the second word .is it is posssible but i will forget theprocedure
Jennifer    16 Feb 2015, 09:35
Thank you Mr Wyatt for saving me hours of work. I have Just used your link to download a find and replace program. Loved loved loved it, so easy to use and hours of work done in 6 minutes.....move over sliced bread!
(by the way one of the links doesn't work)
Sukhvinder    12 Sep 2014, 09:47
Thanks a lot!!!!
Very helpful
Jignesh Pandya    23 Apr 2014, 10:49
I want to extract name of my pdf files from particular folder number of files are very high
Jon    22 Apr 2014, 07:38
Thanks for the kind offer William but the job is done now.
William    12 Apr 2014, 10:57
Hey, I wrote a simple terminal app in java to change the header on multiple word docs at once. Shoot me an email if you are interested
William    12 Apr 2014, 10:55
I wrote my friend a command line java utility to change the header on multiple word documents in a folder. Its bare bones, but gets the job done. Shoot me an email if you are interested and i can email it precompiled
Jon    13 Feb 2013, 05:46
Hi Emily,
I did find various codes to do this but none seemed perfect for what I needed to do which was change an address in the headers of loads of document templates. As the existing addresses could vary slightly, the find/replace didn't work and when it did, the format was sometimes wrong.

I don't know if this works for what you want to do but this is how I did it: I opened a new document and made the header exactly as I wanted it to be. Then opened a document that needed to be changed (make sure that these are the only two Word docs open). Then I went back to the new doc and recorded a macro in it that copies the new header, opens the second document, deletes the entire header and copies in the new header and alters the format (just in case). When it has finished, do a save-as. So when I come across a template that needs changing, I open the doc with the macro in it, run the macro and the job's done. Hope that helps
Emily    13 Feb 2013, 00:33
I same issue John, let me know if you find a solution!
Jon    27 Sep 2012, 05:09
This code is great and works perfectly for replacing text in the body of my Word documents. The trouble is that the text I want to replace is in the document header and this code does not look there. Do you have the code to find/replace in the header please?


Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us


Advertise with Us

Our Privacy Policy

Our Sites


Beauty and Style




DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)



Home Improvement

Money and Finances


Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives


Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2015 Sharon Parq Associates, Inc.