View Single Post
 
Old 05-14-2023, 09:16 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Change the code to
Code:
Sub SubstitutePage()
ActiveDocument.Content.Delete
ActiveDocument.AttachedTemplate.AutoTextEntries("a ne").Insert _
    Where:=ActiveDocument.Range, _
    RichText:=True
End Sub
However why not simply create a template with the required text already present and create the new documents with the required content from that?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote