Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
wrosie wrosie is offline
external usenet poster
 
Posts: 1
Default creating a nested if...then...else rule

I need to create a nested rule that will pull up data this way:

If cand_type = I or if cand_type = J or if cand_type = V or if cand_type = U
then insert this text string.

I know there's a way to do it with additional sets of quotation marks, but I
haven't done this for 10 years or so. I'd be very grateful for some help.
Thanks!
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default creating a nested if...then...else rule

You don't have to do it with /nested/ fields - the following would work
because cand_type could only have one of the four values in any given
record. Assuming it's a merge field, you would have

{ IF "{ MERGEFIELD cand_type }" = "I" "insert this text string"
}{ IF "{ MERGEFIELD cand_type }" = "J" "insert this text string"
}{ IF "{ MERGEFIELD cand_type }" = "V" "insert this text string"
}{ IF "{ MERGEFIELD cand_type }" = "U" "insert this text string" }

The precise layout isn't very important as long as you don't put any
characters between the final } of one IF and the starting { of the next,
butall the {} have to be the special field braces you can insert with
ctrl-F9, and you can use Alt-F9 to toggle between field code view and
field results view.

You could also consider

{ SET s "insert this text string"
}{ IF "{ MERGEFIELD cand_type }" = "I" "{ s }"
}{ IF "{ MERGEFIELD cand_type }" = "J" "{ s }"
}{ IF "{ MERGEFIELD cand_type }" = "V" "{ s }"
}{ IF "{ MERGEFIELD cand_type }" = "U" "{ s }" }

If I,JV and U might actually be i, j, v or u you can do

{ SET s "insert this text string"
}{ IF "{ MERGEFIELD cand_type \*Upper }" = "I" "{ s }"
}{ IF "{ MERGEFIELD cand_type \*Upper }" = "J" "{ s }"
}{ IF "{ MERGEFIELD cand_type \*Upper }" = "V" "{ s }"
}{ IF "{ MERGEFIELD cand_type \*Upper }" = "U" "{ s }" }

Peter Jamieson

http://tips.pjmsn.me.uk

On 25/02/2010 21:28, wrosie wrote:
I need to create a nested rule that will pull up data this way:

If cand_type = I or if cand_type = J or if cand_type = V or if cand_type = U
then insert this text string.

I know there's a way to do it with additional sets of quotation marks, but I
haven't done this for 10 years or so. I'd be very grateful for some help.
Thanks!

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a rule for duplicate entry in excell for a mail merge mwhobg Mailmerge 2 May 7th 09 10:55 AM
Rule not showing up MA Omary Microsoft Word Help 1 December 26th 08 04:25 PM
Creating an If...Then...Else rule for mail merges John Salerno Mailmerge 10 August 28th 08 09:20 PM
Creating nested fields Michael Tissington Mailmerge 1 November 3rd 05 03:02 AM
when using c/o care of what are the rule of use AZVMAX Microsoft Word Help 2 December 13th 04 12:55 AM


All times are GMT +1. The time now is 12:45 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"