senthilkumar
03-30-2009, 04:33 AM
Hi,
I want to find and replace in the given document. My input is in database in the form of FindPattern, ReplacePattern and Wildcard usage(true/false). I have to read the database information and store it an array. Using For loop i will execute the find and replace one by one. This is working fine for documents having less pages (<100 pages). But I try to execute this for more no. of pages then the execution is vely slow and taking more time to process. Is there any solution for this?
Set rngProcess = ActiveDocument.Range
For iCnt = 0 To UBound(sFindPattern)
With rngProcess.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Text = sFindPattern(iCnt) 'find pattern
.Replacement.Text = sReplacePattern(iCnt) 'replace pattern
.MatchWildcards = sWildCards(iCnt) 'wildcard value
.Execute Replace:=wdReplaceAll
End With
Next iCnt
regards,
Senthil. S :banghead:
I want to find and replace in the given document. My input is in database in the form of FindPattern, ReplacePattern and Wildcard usage(true/false). I have to read the database information and store it an array. Using For loop i will execute the find and replace one by one. This is working fine for documents having less pages (<100 pages). But I try to execute this for more no. of pages then the execution is vely slow and taking more time to process. Is there any solution for this?
Set rngProcess = ActiveDocument.Range
For iCnt = 0 To UBound(sFindPattern)
With rngProcess.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Text = sFindPattern(iCnt) 'find pattern
.Replacement.Text = sReplacePattern(iCnt) 'replace pattern
.MatchWildcards = sWildCards(iCnt) 'wildcard value
.Execute Replace:=wdReplaceAll
End With
Next iCnt
regards,
Senthil. S :banghead: