Word IF statement

A

ak_edm

Hi,

The expression...

{ IF FormField = Expected Entry "Good" "Bad" }

works.

Can it be changed to { IF FormField CONTAINS Expected Entry "Good" "Bad" } ?

I want something to happen if the form field contains the word "penguin",
for example.

Thanks.

- Eric
 
P

Peter Jamieson

Not in the general case.

You can do

{ IF FormField = "Expected Entry*" "Good" "Bad" }

to match "Expected Entryblah blah"

and

{ IF FormField = "*Expected Entry" "Good" "Bad" }

to match "blah blahExpected Entry"

but

{ IF FormField = "*Expected Entry*" "Good" "Bad" }

does not match

to match "blah blahExpected Entryblah blah"

You should probably use a VBA Exit macro to check your formfield's
contents, and (for example) populate a Word Document Variable that you
can insert using a { DOCVARIABLE } field.

Peter Jamieson

http://tips.pjmsn.me.uk
 

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