View Single Post
  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor
 
Posts: n/a
Default Multiple conditions in merge

As Doug says, quotes are not *required* around fields, but they are good
practice as they make the construction easier to understand.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Doug Robbins - Word MVP wrote:
As far as I know, the double quotes are only required around a
string that includes spaces, such as

"The amount is between 50 and 100."

but their use around the individual parts (true part, false part) of
the result will not cause a problem.

Such field constructions can be copied and pasted. The important
thing is that the field delimiters {} must be inserted by the use of
Ctrl+F9. The similar looking characters inserted by the use of the
keys on the keyboard will not work. If the field codes disappear,
use Alt+F9 to toggle on their display.


"Stephen Green" wrote in message
...
I"ve tried Doug's code and it works. I don't know if the extra quote
would enhance or detract form the efficacy (I haven't tried).

While we're on the subject, does each Merge Condition have to be
typed or can I cut and paste, the edit them.

So far I have had trouble ceeping track of the Conditions as they
have a tendency to disappear from view...

Stephen


"Stephen Green" wrote in message
...
Thanks, Guys!

I see one difference between your suggestions. There is a double
quote before the second { IF in Graham's suggestion (below) which
is missing in Doug's.

Is this important?

Stephen

"Graham Mayor" wrote in message
...
Oops - a typo - that should read
{ IF { Mergefield Amount } = 50 "{ IF { Mergefield Amount } =
100 "The amount is between 50 and 100" "" }" "" }
Spaces are important!

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Graham Mayor wrote:
{ IF { Mergefield Amount } = 50 "{ IF { Mergefield Amount } =100
"The amount is between 50 and 100" "" }" "" }


Stephen Green wrote:
I can't for the life of me figure out how to insert a field base
on multiple conditions. What I'd like to do, for instance, is
something like this:
If Amount = 50 And Amount =100 Then "The amount is between 50
and 100"
Can anyone help?

Stephen