![]() |
|
|
Thread Tools | Display Modes |
#2
|
||||
|
||||
![]()
You should change your text formfield's internal bookmark name to 'BirthDate' and use a field constructed as:
Code:
{QUOTE {SET sy{BirthDate \@ yyyy}} {SET sm{BirthDate \@ M}} {SET sd{BirthDate \@ d}} {SET ey{Date \@ yyyy}} {SET em{Date \@ M}} {SET ed{Date \@ d}} {Set Years{=ey-sy-(em<sm)-(em=sm)*(ed<sd)}} "{Years} Year{IF{Years}= 1 "" s}"} Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. The spaces represented in the field construction are all required. Although I've used linebreaks in the field code, they're no needed - they just add clarity. To see how to do just about everything you might want to do with dates in Word, check out my Microsoft Word Date Calculation Tutorial (which is where the above field code comes from): https://www.msofficeforums.com/word/...-tutorial.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Have Text Entered in Content Control / PreDefined Field Populate Field in Footer | bzowk | Word | 1 | 04-14-2016 11:50 AM |
Formula to subtract one month from due date field in reminder field | ghumdinger | Outlook | 1 | 10-01-2011 12:09 AM |
![]() |
vandy | Word | 1 | 09-23-2009 11:32 AM |
new appointment date always reverts back to today's date | msills | Outlook | 0 | 08-24-2007 08:57 AM |
![]() |
promark | Outlook | 1 | 12-23-2005 07:21 AM |