I have an embedded word document in my worksheet, names "Rec1"
So using before:
Sub ReplaceTextinOLEObject
Dim oDoc As OLEObject
Set oDoc = Worksheets("Sheet1").OLEObjects("Rec1")
oDoc.Activate
With oDoc.Content.Find
.ClearFormatting
.Text = "hi"
.Replacement.ClearFormatting
.Replacement.Text = "hello"
.Execute Replace:=wdReplaceAll, Forward:=True, Wrap:=wdFindContinue
End With
Word.Application.Quit wdDoNotSaveChanges
End Sub
When perform running above, the With part committed below error:
Run-time error '438':
object doesn't support this property or method
What is the problem of the using Find object for OLE embedded word documents?