I did some research, but—like you—I found no documentation.
It appears that this error can sometimes be caused by not clearing find/replace text.
I have tested the code below with several different inputs, and it is running without errors.
Note: code requires checking Tools -> References -> Microsoft Word xx.0 Object Library.
Sub TextReplace()
Dim oWord As Word.Application
Dim oDoc As Word.Document
Dim oFind As Find
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
Set oDoc = oWord.Documents.Add("C:\in.doc")
Set oFind = oDoc.Range.Find
oFind.Execute "foo", , , , , , , , , "bar", wdReplaceAll
oDoc.SaveAs ("C:\out.doc")
oDoc.Close
oWord.Visible = False
End Sub
Feel free to update your question with any errors you get while running this code.