I have a Word document with two bookmarks. Upon saving the document I want to insert a certain text between those bookmarks.
Here’s what I tried:
Sub FileSave()
Dim myRange As Range
Set myRange.Start = ActiveDocument.Bookmarks("SaveDateStart").Range.End
Set myRange.End = ActiveDocument.Bookmarks("SaveDateEnd").Range.Start
myRange.SetRange Start:=myRange.Start, End:=myRange.End
ActiveDocument.Range(myRange).Text = "Lorem Ipsum"
ActiveDocument.Save
End Sub
But this gives me an error “invalid use of property” in the assigment of myRange.Start, as shown in the screenshot below.
What am I doing wrong?
