Hi there. I am trying to use this feature to replace a text with another.
I have already selected the text and went to quicks parts/autotext/save selection to autotext gallery
However when I run the macro, I got the error 5941, telling that the element doesn't exist. I checked the name used to save the selected text and it is correct, so I dont know what is the problem.
The macro is the following:
Sub Document_Open()
SubstitutePage
End Sub
Sub AutoOpen()
SubstitutePage
End Sub
Sub SubstitutePage()
ActiveDocument.Content.Select
Selection.Delete
ActiveDocument.AttachedTemplate.AutoTextEntries("a ne").Insert Where:=Selection.Range, RichText:=True
End Sub