Go4Expert

Go4Expert (http://www.go4expert.com/)
-   ASP (http://www.go4expert.com/forums/asp/)
-   -   Find and Replace (http://www.go4expert.com/forums/find-and-replace-t1506/)

kalees 30Sep2006 17:07

Find and Replace
 
Hi,

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

Thanks,
Kalees


All times are GMT +5.5. The time now is 02:20.