Multiple if conditions

M

Mark Wallace

I am trying to get a mail merge document to work as follows:-

The database has an office field.

If the field is "bus" I want the merger result to be the text word
"business" in my document
If the field is "ltd" I want the merger result to be the text word
"limited" in my document
If the field is any thing else I would like the text work "office" to
be printed.

How do you do a multiple word

Mark
 
P

Peter Jamieson

Use Alt-F9 to toggle between "field codes" and "feild results" view.

Use ctrl-F9 to insert each pair of the special field code braces {}

Type everything else.

Try

{ IF { MERGEFIELD office } = "bus" "business"
"{ IF { MERGEFIELD office } = "ltd" "limited"
"office" } "office" }

(You don't have to lay it out like that - it can all be on one line)

If you need to deal with mixed-case versions of "bus" etc., use

{ IF { MERGEFIELD office \*Upper } = "BUS" "business"
"{ IF { MERGEFIELD office \*Upper } = "LTD" "limited"
"office" } "office" }

Peter Jamieson
 
D

Doug Robbins - Word MVP

{ IF { MERGEFIELD office } = "bus" "business" { IF { MERGEFIELD office } =
"ltd" "limited" "office" } }

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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