{If } doesn't work

G

Guest

I am trying to create a date field which inserts the CreateDate or where
applicable the SaveDate. This is to avoid having new docs from templates
opening with zeros and 'x's prior to saving, which happens if there's a
savedate.

I have put this into a field but it will not work.

{ IF { SAVEDATE } > { CREATEDATE } { SAVEDATE /@ "ddMMMMyyyy" } {CREATEDATE
/@ "ddMMMMyyyy" } }

Using Office 2007 and Vista.

Thanks!
 
G

Guest

Try this:

{ IF { SAVEDATE \# "0" } = 0 "{ CREATEDATE /@ "ddMMMMyyyy" }" "{ SAVEDATE
/@ "ddMMMMyyyy" }" }
 
G

Graham Mayor

It might work better with the slashes the right way round? ;)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Guest

Thank you both. Graham's code returns "SAVEDATE" while Stefan's (with the
right switches) returns 'Error! Too many picture switches defined'
 
G

Guest

Thank you both. Graham's code returns "SAVEDATE" while Stefan's (with the
right switches) returns 'Error! Too many picture switches defined'
 
S

Stefan Blom

In the code I suggested, did you remember the quotation marks? Did you
put spaces between the first SAVEDATE field and the equal sign? If you
still can't get it to work, try using \@ "M" instead of \# "0":

{ IF { SAVEDATE \@ "M" } = 0 "{ CREATEDATE \@ "ddMMMMyyyy" }" "{
SAVEDATE \@ "ddMMMMyyyy" }" }

--
Stefan Blom
Microsoft Word MVP


in message
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top