Hi there.
I am trying to open a word document and insert text from Excel into the bookmarks. However, I am receiving the error '"Automation Error (438). Object doesn't support this property or method"' when the code below runs. Can you help?
Code errors at
.Open "http://collaborationcentre.sharepointname/Doc1.docx"
Private Sub Generate_Click()
Worksheets("Message Templates").Activate
Range("F10") = TitleTextBox.Value
Range("G10") = SurnameTextBox.Value
Range("H10") = ComboBox1.Value
Dim objWord As Object
Set objWord = CreateObject("Word.Application")
With objWord
.Visible = True
.Open "http://collaborationcentre.sharepointname/Doc1.docx"
.Selection.Goto What:=wdGoToBookmark, Name:="Title"
.Selection.TypeText Text:=Range("F10").Value
.Selection.Goto What:=wdGoToBookmark, Name:="Surname"
.Selection.TypeText Text:=Range("G10").Value
End With
End Sub
Bookmarks