Need help with Field Codes
- From: "Rhino" <no.offline.contact.please@xxxxxxxxxx>
- Date: Fri, 16 Jun 2006 19:19:40 -0400
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
.
- Follow-Ups:
- Re: Need help with Field Codes
- From: Suzanne S. Barnhill
- Re: Need help with Field Codes
- Prev by Date: Margins warning when printing
- Next by Date: Re: how do I type a thin space in Word?
- Previous by thread: Margins warning when printing
- Next by thread: Re: Need help with Field Codes
- Index(es):
Relevant Pages
|
Loading