Word 2007 IF field

B

bs2442

I am trying to create a template in Word 2007. I want to have several lines
below an IF field automatically delete when the results of the IF are true.
I've tried
IF type = "fel" " "
type is my bookmark, "fel" is the expression I'm looking for, deleting the
lines below the field is the result I want if "fel" is entered, but no matter
how I write it, it doesn't work.
 
J

Jay Freedman

bs2442 said:
I am trying to create a template in Word 2007. I want to have several
lines below an IF field automatically delete when the results of the
IF are true. I've tried
IF type = "fel" " "
type is my bookmark, "fel" is the expression I'm looking for,
deleting the lines below the field is the result I want if "fel" is
entered, but no matter how I write it, it doesn't work.

That isn't the way IF fields are designed.

An IF field has four parts:

- The keyword, IF
- The comparison that generates a True or False value, in this case, type =
"fel"
- The text that appears as the result of the field if the comparison is True
- The (optional) text that appears as the result of the field if the
comparison is False

None of these have any effect on text that is outside the field -- so the
field cannot "erase" any amount of text in the lines below the field.

What you _can_ do is use an empty string "" as the True text and the other
lines (including paragraph marks or manual line breaks) as the False text.

Or you can turn it around -- use type <> "fel" as the comparison, make the
other lines the True text, and omit the False text (which is then assumed to
be an empty string).

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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