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.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Word allows you to add several types of "breaks" into your document. If you later want to remove any of them, you can use ...Discover More
What happens when you copy information from one document and paste it into another? It is possible for what you paste to look ...Discover More
If you know the character codes for some characters of interest, you can use those codes to do lots of tasks. This tip ...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.