Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. 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: Enforcing a Do-Not-Use Word List.
Written by Allen Wyatt (last updated November 18, 2021)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365
Rohan works for a company that is using a new method of writing letters involving a list of approximately a hundred 'complex' words that must never be used when writing. He is looking for the best way to be alerted if any of the words on the list are used in a document.
There are several ways that this can be accomplished, and the best choice will depend on how work is done in your office, along with personal preference. For instance, one simple way to handle the words is to add them to what Word calls your "exclude" dictionary. Basically, this is a way of modifying the files used by the spell checker so that a particular word is always marked as incorrectly spelled. If you add the hundred words to the exclude list, then they will always be marked as incorrectly spelled. How you add words to the exclusion dictionary has been covered in other issues of WordTips. You can find information here:
https://wordribbon.tips.net/T008695
Similar information is also available at the Word MVP site, here:
https://wordmvp.com/FAQs/General/ExcludeWordFromDic.htm
Another way you could approach your list is to create AutoCorrect entries for each of the words. When one of the words is typed, you could have it automatically replaced with a version of the word that is in some noticeable format that will call attention to the fact that the word was used. If you prefer, you could also simply have the word replaced with a space, which would mean that the offending word is automatically "erased" whenever it is typed.
There are also macro approaches that you could use. These would, primarily, be helpful to run at various points in the development of the document. The macro could do just about anything you decide it should do. For instance, it might simply collect the offending words that were found in the document and notify you that they were found, without actually making any changes. The following macro will do just that.
Sub DoNotUseList() Dim Word As Range Dim ForbiddenWords(2) As String Dim ForbiddenWord As Variant Dim BadList As String ' Populate array with forbidden words ' Remember to modify the size of the array above ForbiddenWords(0) = "cat" ForbiddenWords(1) = "dog" ForbiddenWords(2) = "mouse" BadList = "The following forbidden words have been identified:" For Each Word In ActiveDocument.Words For Each ForbiddenWord In ForbiddenWords If LCase(Trim(Word.Text)) = ForbiddenWord Then BadList = BadList & vbCrLf & ForbiddenWord End If Next Next MsgBox BadList, vbOKOnly, "Forbidden Words" End Sub
To change the words that are on the forbidden list, simply change the size and contents of the ForbiddenWords array. You should make sure that there are no capital letters and no phrases in the array contents. When you run the macro, each of the words in the document is checked against each of the forbidden words, and you are notified at the end if there are any found.
Other similar macro-based ways to handle this type of problem have been presented in other issues of WordTips:
https://wordribbon.tips.net/T001173
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11329) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Enforcing a Do-Not-Use Word List.
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!
Sometimes a writer needs motivation to keep ploughing ahead in their craft. Word doesn't really include any tools to help ...
Discover MoreNeed to grab a list of unique words appearing in a document? You can tap the power of VBA's Words collection to perform ...
Discover MoreIf you need to move master documents or subdocuments from one place to another on your computer, you have to keep in mind ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2018-09-10 12:22:00
Nick
Hey Allen!
This is quite an interesting approach for consistent terminology.
I got 3 questions:
1. Question
Is there a possiblity to copy the results to clipboard (to paste it somewhere else)?
2. Question
Do you know a way how to also create a match for plural forms while not listing all the plural forms seperately?
E. g. the search in your shown example gives no results if the word "cats" appears.
In other words: I additionally want a match, when the string appears "inside" of a word.
3. Question
Is there a possibility to extend the list for connected words like "black spider".
So a match would only come if both words appear.
Gratefully yours,
Nick
2018-04-18 05:09:35
Vikram
This is super helpful, thanks so much! What changes need to be made in the code to make this work in Outlook or Powerpoint?
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.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments