View Single Post
 
Old 02-10-2023, 01:31 AM
Ddadoo57 Ddadoo57 is offline Windows 11 Office 2021
Advanced Beginner
 
Join Date: Feb 2023
Posts: 90
Ddadoo57 is on a distinguished road
Default

I added the following code, to manage my autotext PDPVF1
...
.Fields.Add Range:=oRng, Type:=wdFieldIf, Text:="{PAGE} = {NUMPAGES} {AUTOTEXT}", PreserveFormatting:=False
...
.Collapse 0
.MoveEndUntil "}"
.End = .End + 1
.MoveStartUntil "{"
.Text = ""
.Fields.Add Range:=oRng, Type:=wdFieldAutoText, Text:="PDPVF1", PreserveFormatting:=False
...
Reply With Quote