View Single Post
  #4   Report Post  
Posted to microsoft.public.word.newusers
Suzanne S. Barnhill
 
Posts: n/a
Default Need help with Field Codes

You did not mention a mail merge. Date fields are not compatible with mail
merges.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Rhino" wrote in message
...
There's got to be some kind of a knack that I'm just not getting here.

I tried doing a CTRL-F9 to produce a pair of heavy braces at the right

point
in my document. That worked. Then, when I pasted the exact string you
provided in your note, including the spaces, that seemed to work too. But

as
soon as I pressed the "Propagate" icon on the Mail Merge toolbar, the spot
where I had entered the field code said !Syntax Error, {.

VENT
I've been messing with this seemingly simple task of inputting a formula

for
calculating the next year for something like two hours and my head's

getting
sore from banging it on the wall. I seem to have tried every variation I

can
imagine of DATE, SET, =, and everything else I could think of and it
inevitably gets me a syntax error!! What the heck is going on here?? I've
done a Google search on the newsgroup and seen several variations of your
suggestion supplied by various responders and none of them seem to have

any
followup questions, which gives the impression that the original poster

had
no problem using this formula in their documents. So why do I alone seem

to
have problems with this?? Is there some kind of document wide setting that
has the wrong value or something??
/VENT

For what it's worth, I've also tried doing Insert/Field, selecting =, then
entering { DATE \@ "YYYY" } +1
in the Formula field, then choosing 0 as the number format. That doesn't
work either. I've tried using lowercase "yyyy" instead of "YYYY". That
didn't help. Everything leads me back to this Syntax Error.

What boneheaded mistake am I making here?

--
Rhino



"Suzanne S. Barnhill" wrote in message
...
No need for a QUOTE field. This works just fine for me (Word 2003) with
this
syntax:

{ = { DATE \@ "YYYY" } +1 }

Note the spaces.


--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the

newsgroup
so
all may benefit.

"Rhino" wrote in message
...
I'm trying to put a field code into my Word 2002 document but having

trouble
getting the syntax just right.

I want the field code to be replaced by the current year plus 1.

Therefore,
if the document is being generated today, I want the field code to put

2007
at a specifc place within my document.

I know that the field code {DATE \@ "YYYY"} will give me the current
year.

I'm struggling with how to write the field code that will give me the
next
year. First of all, I'm not sure whether I can write an expression that

adds
1 to year and display that result directly or whether I have to first
transform that result to a character string. Second, I'm not sure how

to
get
the result even as an integer.

To get an integer result, I'm guessing that I have to use an = formula,
something like this:

{={DATE \@ "YYYY"}+1}

To get a character string result, I'm guessing that I have to imbed all
of
that in a QUOTE, something like this:

{QUOTE "{={DATE \@ "YYYY"} +1}/1 \@ "YYYY"}

This last guess was inspired by the Help article on QUOTE.

Unfortunately, I inevitably get a Syntax Error whenever I try to use

either
approach, no matter how carefully I try to write the field code. (I'm a
veteran programmer and I know how important it is to get the syntax of

a
statement just right.) What's worse is that everytime I get the Syntax
Error, the original field code is destroyed and I have to painstakingly

type
it all in again rather than just altering it and trying it again.

Can anyone help me out?

--
Rhino