Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, and 2013. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Highlighting Duplicate Words.
by Allen Wyatt
(last updated August 23, 2014)
Joe is an author and he has some ideas for using Word macros to help with his proofreading. One of the macros he wants to build is for finding duplicate words in sentences and paragraphs. He wants to exclude the common necessary words like "the," "a," etc. Joe would like to highlight the duplicate words in a document so he can examine their use and make appropriate changes.
How you go about this depends, really, on how you want to approach the task. For instance, if you want to simply look for duplicate words that are side-by-side, then Word should do that already for you; the grammar checker takes care of marking those duplicate words.
If you, instead, want to find excessive instances of a particular word, then you can use Find and Replace to highlight them. On the Find tab of the Find and Replace dialog box you can enter the word you want to highlight, click the Highlight All Items check box, and then click Find All. Word selects all instances of the Word and you can then use the Highlighter tool to highlight all of them.
Finally, if you want a macro that will step through each paragraph of the document (or each sentence of a document) and look for multiple instances of any given word, then that is a much more complex issue. Stepping through either paragraphs or sentences is not a huge problem; just use either the Paragraphs collection or the Sentences collection in the macro. The bigger problem is dealing with text variations. For instance, does the word "dog" match the word "dogs" or, even, the word "dogged." Without a firm understanding of what, exactly, you want to consider as "matching," your macro can get rather cumbersome.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13218) applies to Microsoft Word 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Word here: Highlighting Duplicate Words.
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!
Editing text to turn regular words into hyphenated phrases can be a real bother. The chore can become a breeze if you apply ...Discover More
Section breaks are used to divide a document into two or more sections that can be independently formatting. If you want to ...Discover More
If you have a group of people working on a single document, you may wonder what tools are available in Word to facilitate the ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.