Creating a macro for finding a set of words in Word? thanks

note235

Golden Member
Dec 23, 2005
1,502
7
81
For an essay i have to do in school there are these set of words we cannot use----how would i create a macro to either find all of these words or highlight all of these words in this list?
thank you
 

note235

Golden Member
Dec 23, 2005
1,502
7
81
well is here a macro macropod
developed

Dim docCurrent As Document
Dim wrdRef As Object
Application.ScreenUpdating = False

Options.DefaultHighlightColorIndex = wdBrightGreen

Set docCurrent = ActiveDocument
sCheckDoc = "c:\checklist.doc"
Set docRef = Documents.Open(sCheckDoc)
docCurrent.Activate
With docCurrent.Content.Find
.ClearFormatting
With .Replacement
.ClearFormatting
.Highlight = True
.Text = "^&"
End With
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
For Each wrdRef In docRef.Words
If Asc(Left(wrdRef, 1)) > 32 Then
.Text = "<" & Trim(wrdRef) & ">"
.Execute Replace:=wdReplaceAll
End If
Next
End With
docRef.Close
Application.ScreenUpdating = True
End Sub

how should i modify that to exclude certain words?