I have to find and replace the given words in a word document. but my program always replace the words with the first value of the replace string array. please anyone help me what is wrong in the code,
Code:
objWordobject.Selection.Find.ClearFormatting
objWordobject.Selection.Find.Replacement.ClearFormatting
With objWordobject.Selection.Find
.Forward = True
.Wrap = wdFindContinue
.FORMAT = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
do while not findRs.eof
.Text = findRs(1)
for i= LBound(vReplText) To UBound(vReplText)
.Replacement.Text = vReplText(i)
.Execute ,,,,,,,,,,wdReplaceAll
Next
findRs.movenext
loop
End With
Kalees
