Word Duplication Macro

by Eric Gans

One of the worst sins of writing is the inadvertent repetition of the same or similar words in near proximity. This macro looks for duplicate words (and word beginnings) in a text file. It highlights each duplicate in turn and allows you to edit the file as you go along; you can go through the file a second or third time if you like.

Installation Instructions

  1. Download the file wdrep.zip to your computer. (Right-click on the link, then go to Save Target As..)
  2. Extract the three files: wdrep.bas, WdRepForm.frm, and WdRepForm.frx .
  3. Open Word, then type Alt-F11 to open the Visual Basic window.
  4. Type Ctl-M to open the Import File window.
  5. Import wdrep.bas and WdRepForm.frm from the directory to which you extracted them in (2) (two separate operations).
    NB: Since the only function of the three lines of wdrep.bas is to load the "frm" file, you may find it easier to include this subroutine in your default macro module (automatically called "NewMacros").
  6. Return to Word by clicking on the "W" icon.
The wdrep macro is now installed. It can be accessed through the Tools menu, or by typing Alt-F8.

Customizing

There are four Const expressions in the WdRepForm.frm file (available to edit after installation via Alt-F11) that may be changed to reflect your preferences:

Disclaimer

This macro should work with any version of MSWord from 95 to XP; nothing is guaranteed, of course. Please report any bugs to me.


Eric Gans / gans@humnet.ucla.edu
Last updated: