P
Public WithEvents Me
Hi All,
We are having a serious word crashing problem at our clients sites.
We are basically doing a search and replace using the Range object. Heres
the sub we are using:
Sub ReplaceAllInRange(sFindString As String, sReplaceString As String,
oRange As Word.Range)
oRange.Find.Clearformatting
With oRange.Find
.Text = sFindString
.Replacement.Text = sReplaceString
.Replacement.Font.colorindex = 0
End With
oRange.Find.Execute
If oRange.Find.Found Then
oRange.Find.Execute Replace:=wdReplaceAll
End If
End Sub
oRange is bascially set to activedocument.range and passed in (as same
routine is used on multiple documents). As soon as we hit the
oRange.Find.Execute line, Word either freezes or Dr Watsons and bombs out.
We are using Windows NT 4.00.1381, Office 97 SR2 (Application.version =
8.0b)
Any suggestions welcome - Thanks
Chris
We are having a serious word crashing problem at our clients sites.
We are basically doing a search and replace using the Range object. Heres
the sub we are using:
Sub ReplaceAllInRange(sFindString As String, sReplaceString As String,
oRange As Word.Range)
oRange.Find.Clearformatting
With oRange.Find
.Text = sFindString
.Replacement.Text = sReplaceString
.Replacement.Font.colorindex = 0
End With
oRange.Find.Execute
If oRange.Find.Found Then
oRange.Find.Execute Replace:=wdReplaceAll
End If
End Sub
oRange is bascially set to activedocument.range and passed in (as same
routine is used on multiple documents). As soon as we hit the
oRange.Find.Execute line, Word either freezes or Dr Watsons and bombs out.
We are using Windows NT 4.00.1381, Office 97 SR2 (Application.version =
8.0b)
Any suggestions welcome - Thanks
Chris