Use bookmark in IF statement

L

Lodewijk

word 2007
I'm trying to use the value from a bookmark btwinex in an if statement.
The value of the bookmark is inBTW
The if statement {IF {REF btwinex }="inBTW" "prices are incl." "prices are
excl."\*MERGEFORMAT }
If the value of the bookmark is inBTW I keep getting the text prices are excl.
If I change the IF statement to {IF {REF btwinex }="" ...... I get the text
prices are incl.
It seems that the bookmark empty after the merge. Can you use the value of a
bookmark in an if statement. If so how?
 
P

Peter Jamieson

Bookmarks are destroyed during the merge, which may explain the problem
you are seeing.

On the other hand, if the bookmark exists at the time the IF field is
executed, then I suggest you (a) put spaces either side of the "=" sign
and (perhaps) quote the REF field (although in practice I think that
would only make any difference if you also have a bookmark called
"inBTW"). e.g.

{IF "{REF btwinex }" = "inBTW" "prices are incl." "prices are
excl."\*MERGEFORMAT }

Also, be sure that all the {} are the special "field code braces" that
you can insert using ctrl-F9, not the ordinary ones you can enteron the
keyboard.

Peter Jamieson

http://tips.pjmsn.me.uk
 
L

Lodewijk

Thanks Peter for your explanation and suggestion. I will give it a try. I
willl let you know if it is working.
 

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