.find.execute causing DR Watson. Please help!

  • Thread starter Public WithEvents Me
  • Start date
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
 
P

Public WithEvents Me

Oh yeah, some extra info that may help:

- Crashing happens about 6 times out of 10 (we use the same document over
and over - 4/10 it's ok, 3/10 Dr Watsons, 3/10 Freezes)
- Service Pack 6 has been applied to the machine
- Debug info Dr Watson dialog displays is:-

Winword.exe Exception: Access Violation (0xc0000005)
Address: 0x3000a816.

Thanks
 
Top