locked
Add 30 days to current date Word field RRS feed

  • Question

  • I am trying to create a field that when the Word file is opened automatically displays the current date + 30 days in the format 11/09/2016. I have looked into the non-trivial field format but it doesn't display anything:

    { QUOTE "{ SET " Delay" "30" }
    {  SET "DaysInMonth" { IF { CreateDate \@ "MM" } <> 2 
    {  = ROUND(30.575*{ CreateDate \@ "MM" },0)-
    ROUND(30.575*{ = { CreateDate \@ "MM" } -1 },0) }
    {  IF {  = MOD( { CreateDate \@"yy" } , 4 ) } > 0 "28" "29" } } }
    { SET "NextMonth" {  IF {  CreateDate \@ "MM" } = 12 "1/97" 
    "{ = {  CreateDate \@ "MM" } + 1 }/97 } }
    {  IF {   = {  REF "Delay" } + { CreateDate \@ "dd" } } <= { REF"DaysInMonth" }
    { CreateDate \@ "MMMM { = {  REF "Delay" } + { CreateDate \@ "dd" } }, yyyy"}{ QUOTE { NextMonth \@ "MMMM" } 
    { = { REF "Delay" } + { CreateDate \@ "dd" } - { REF"DaysInMonth" } }, 
    { IF { CreateDate \@ "MM" } <> 12 { CreateDate \@ "yyyy" }
    { CreateDate \@ "{ = 1 + { CreateDate \@ "yyyy" } \# "xxxx" }" } } } }" }

    I cannot go the VBA route, because it will change the Word file format to macro and it needs to be .doc



    • Edited by Rick131 Tuesday, October 11, 2016 11:32 AM
    Tuesday, October 11, 2016 11:31 AM

Answers

All replies