Troubleshooting a field script to calculate a date

I'm teaching myself how to use the field editing in Microsoft Word 2007 using an example from http://addbalance.com/word/datefields2.htm
I have entered it all in manually adding all the { } using ctrl+f9. At the end I right clicked the field and selected 'update field' and the only value showing based on today's date was: 8,2008

The attached code is pasted from the website, not from what I've entered. I'm having trouble getting the code on the clipboard, I'm going over it again now carefully. I'm putting this question here now in case any expert out there can see a glaring syntax error or comment on common oversights.

Thank you
{ QUOTE "{ SET " Delay" "14"  }
{  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" }" } } } }" }

Open in new window

LVL 1
sirjulioAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GrahamSkanRetiredCommented:
That particular set of nested fields is the reason that I always recommend using VBA for date arithmetic. In my opinon it is far too difficult to type in for for practical use.

It is certainly not the place to start learnng about fields.

You could try attaching a document with your efforts here. Perhaps someone will have the time to debug it.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sirjulioAuthor Commented:
Thanks Graham that actually sounds like a great idea. I'll close this question here and create a new one in the VBA zone
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.