Sub
mytest5()
Dim
myRange
As
Range, AktWord
As
Variant
Dim
AllWord()
As
String
, iWord
As
Long
, Found
As
Boolean
Dim
TmpStr
As
String
Set
myRange = ActiveDocument.Range
Dim
xlApp
As
Object
Dim
SuchRange
As
Object
, AktZelle
As
Object
Set
xlApp = GetObject(,
"Excel.Application"
)
Set
SuchRange = xlApp.Range(
"A1:A200"
)
With
SuchRange
For
Each
AktZelle
In
SuchRange
ReDim
Preserve
AllWord(iWord)
AllWord(iWord) = AktZelle
iWord = iWord + 1
Next
End
With
Set
myRange = ActiveDocument.Range
With
myRange
For
Each
AktWord
In
.Words
TmpStr = Trim(AktWord.Text)
For
iWord = 0
To
UBound(AllWord)
If
TmpStr = AllWord(iWord)
Then
AktWord.Font.Color = wdColorRed
End
If
Next
Next
End
With
Set
SuchRange =
Nothing
Set
myRange =
Nothing
End
Sub