A Microsoft Word forum. Microsoft Office Word Forum - WordBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Microsoft Office Word Forum - WordBanter forum » Microsoft Word Newsgroups » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Multiple conditions in merge



 
 
Thread Tools Display Modes
  #1  
Old December 18th 05, 09:49 AM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Multiple conditions in merge

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


Ads
  #2  
Old December 18th 05, 11:41 AM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Multiple conditions in merge

{ IF { MERGEFIELD Amount } = 50 { IF { MERGEFIELD Amount } = 100 "The
amount is between 50 and 100." "" } "" }

You must use Ctrl+F9 to insert each pair of field delimiters and make sure
that you have a space either side of the operator =. You use Alt+F9 to
toggle off the display of the field codes.

--
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

"Stephen Green" wrote in message
...
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



  #3  
Old December 18th 05, 11:49 AM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Multiple conditions in merge

{ IF { Mergefield Amount } = 50 "{ IF { Mergefield Amount } =100 "The
amount is between 50 and 100" "" }" "" }

--

Graham Mayor - Word MVP

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



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



  #4  
Old December 18th 05, 02:26 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Multiple conditions in merge

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



  #5  
Old December 18th 05, 10:34 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Multiple conditions in merge

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





  #6  
Old December 18th 05, 11:06 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Multiple conditions in merge

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







  #7  
Old December 19th 05, 05:53 AM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Multiple conditions in merge

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.

--
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

"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








  #8  
Old December 19th 05, 07:15 AM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
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



  #9  
Old December 19th 05, 08:01 AM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Multiple conditions in merge

Thanks Doug!

The Alt-F9 key did the trick. Now if I only understood the code you gave
me!!!

Thanks again to you and Graham!

Stephen

"Doug Robbins - Word MVP" wrote in message
...
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.

--
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

"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










  #10  
Old December 19th 05, 12:53 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Multiple conditions in merge

An alternative field construction is:
{IF{=({MERGEFIELD Amount}50)+({MERGEFIELD Amount}100)}= 0 "The amount is
between 50 and 100"}

Cheers
PS: The output text really should have ", inclusive" at the end.


"Stephen Green" wrote in message
...
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




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I create a merge document from multiple sources? Khrissi Mailmerge 2 October 14th 05 06:00 AM
Saving final document to multiple files when merge document has multiple section Shannon W via OfficeKB.com Mailmerge 1 September 19th 05 05:31 AM
Combining multiple merge documents cth5c Mailmerge 1 June 15th 05 11:14 AM
Multiple merge with IncludeText generating extraneous hidden chara Judy Mailmerge 4 May 5th 05 03:51 PM
Merge multiple documents? George M. Lutz New Users 1 November 27th 04 02:06 PM


All times are GMT +1. The time now is 06:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2004-2018 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.