I am trying to write a Word document from Excel VBA, and when I try to use a method .TypeTextfor an object Selection, I get an error: "The object does not support this property or method."
I read somewhere that Excel VBA does not know what I mean by the Selection object in a Word document, so I tried the proposed solution, which was to try to do this in With- End With.
I basically tried this:
Set WrdApp = New Word.Application
Set DestDoc = WrdApp.Documents.Add
With DestDoc
.Activate
.Select
.Selection.TypeText Text:="Test"
End With
But it always reports the same error on the line .Selection.TypeText.
Any help would be appreciated.
Srlle source
share