Create a list of words "not to use"

O

Olivia

Is there a way to create a list of words in MS Word, so when spell check is
performed it will catch those words.

Or is there a way to create a list of words not to use when typing a word
document.

Thanks
 
M

Microsoft

Is there a way to create a list of words in MS Word, so when spell
check is performed it will catch those words.

Or is there a way to create a list of words not to use when typing a
word document.

Thanks

Create a new user dictionary?
 
G

Greg Maxey

Olivia,

I am not sure if you can do that with the spellchecker. You could create a
macro to check the document for bad or inappropriate words.

I haven't thought about this in great detail so there could be a much better
way, but basically you would create a collection of the bad words with a key
(the key is the same word repeated) then you attempt to add each word in the
document to the collection. If the word is a bad word already in your
collection then you can trap the error to process the bad word.

Sub FlagBadWords()
Dim colBadWords As Collection
Dim oWord As Range
Set colBadWords = New Collection
'Create your collection of bad words
With colBadWords
.Add "booger", "booger"
.Add "poop", "poop"
End With
For Each oWord In ActiveDocument.Words
On Error GoTo Err_Handler
colBadWords.Add LCase(Trim(oWord)), LCase(Trim(oWord))
colBadWords.Remove LCase(Trim(oWord))
Err_ReEntry:
On Error GoTo 0
Next
Exit Sub
Err_Handler:
If Err.Number = 457 Then
MsgBox oWord & " is a bad word and will be flagged."
If oWord.Characters.Last = " " Then oWord.MoveEnd wdCharacter, -1
oWord.HighlightColorIndex = wdBrightGreen
Resume Err_ReEntry
Else
MsgBox Err.Number & " " & Err.Description
End If
End Sub


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top