![]() |
#1
|
|||
|
|||
![]()
Hello,
I am a trainer and in my exercises, I have dates. Instead of changing the dates manually every year, I have automated them by : 1 - Creating an advanced property "Year" that I change every year (File/Information/Properties/Advanced properties/Customization) 2 - In the body text, at each date : - Insert/QuickPart/Field/ok - It indicates me "! unexpected end of formula". - Right click to "Toggle field codes" : {.=..* MERGEFORMAT } - I put myself after = then Insert/QuickPart/Field/PropertyDoc/Year : {.=.2021.\* MERGEFORMAT } - I put myself after 2021 and I add +1, +2 or -1 - Right click and "update fields" recalculates the date. This gives me { { DOCPROPERTY Year \* MERGEFORMAT } + 1 \* MERGEFORMAT } 3 - Each year I change the date in properties, I recalculate => it's ok Instead of doing each time the manipulation by hand, I tried a VBA macro : Code:
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="= ", PreserveFormatting:=Tru Code:
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:="DOCPROPERTY Annee ", PreserveFormatting:=True But how do I combine the two? There is a field type wdFieldDocProperty but I don't know how to use it. Thank you for your solution... |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
innkeeper9 | Excel | 2 | 09-13-2016 08:59 PM |
![]() |
CepheiMD | Word | 2 | 03-18-2016 01:56 AM |
![]() |
david_89_ | Mail Merge | 3 | 03-26-2014 06:02 AM |
Formula Field using Field Codes | hunter2193 | Word | 3 | 04-05-2013 04:58 AM |
Formula to subtract one month from due date field in reminder field | ghumdinger | Outlook | 1 | 10-01-2011 12:09 AM |