Stub receives Bad data during Replace

B

Bob Schild

In a VB6 project when I run the following on my active
document I get an error stating "Automation Error The stub
received bad data"
Private Function PassOne() As Boolean
Dim DOC As Word.Document
Dim bolRTN As Boolean

On Error GoTo PassOne_Error

Set DOC = appWord.ActiveDocument

bolRTN = DOC.Content.Find.Execute(findText:="PERSONAL",
ReplaceWith:="TEST", Replace:=wdReplaceAll)

PassOne_Exit:
Exit Function
PassOne_Error:
MsgBox Err.Description
PassOne = False
Resume PassOne_Exit
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top