View Single Post
 
Old 02-11-2022, 09:51 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,138
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

Why not simply insert a DATE field (or a CREATEDATE field if it is a template)
{ DATE \@ "yyyy" } or { CREATEDATE \@ "yyyy" } ? This will always show the year (or in the case of the latter the year the document was created.

To insert a DocProperty field
Code:
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldDocProperty, Text:="Annee", PreserveFormatting:=False
__________________
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