Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Yve Ke Yve Ke is offline
external usenet poster
 
Posts: 23
Default if...then...else

I would like to insert a series of if then else word fields into a mail merge
letter but if they are not satisified i want the whole thing suppressed
rather than have a space devoted to it. I guess it is something that you
have to do with switches but not sure how. Any help appreciated.

Yve
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default if...then...else

Do it like this:

{ IF { MERGEFIELD MiddleName } = "" "{ MERGEFIELD LastName }" "{ MERGEFIELD
MiddleName } { MERGEFIELD LastName }" }

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

"Yve Ke" wrote in message
...
I would like to insert a series of if then else word fields into a mail
merge
letter but if they are not satisified i want the whole thing suppressed
rather than have a space devoted to it. I guess it is something that you
have to do with switches but not sure how. Any help appreciated.

Yve



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Yve Ke Yve Ke is offline
external usenet poster
 
Posts: 23
Default if...then...else

Thanks for the advice about getting rid of the then...else but it still isn't
working. I want to do the following produce a list (sort of)
{ IF { MERGEFIELD Blah } = "Jack" "Jack" }
{ IF { MERGEFIELD BlahBlah} = "Jack" "Jack" }
{ IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack" " }
But if it isn't satsiafied it will give me a blank line which I don't want
Hope you can help

Yve


"Doug Robbins - Word MVP" wrote:

Do it like this:

{ IF { MERGEFIELD MiddleName } = "" "{ MERGEFIELD LastName }" "{ MERGEFIELD
MiddleName } { MERGEFIELD LastName }" }

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

"Yve Ke" wrote in message
...
I would like to insert a series of if then else word fields into a mail
merge
letter but if they are not satisified i want the whole thing suppressed
rather than have a space devoted to it. I guess it is something that you
have to do with switches but not sure how. Any help appreciated.

Yve




  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default if...then...else

That's because you have your Blahs and Jacks in the wrong places. They need
to go on the same line and the line feed needs to be included between the
quotes.

{ IF { MERGEFIELD Blah } = "Jack" "Jack
" }{ IF { MERGEFIELD BlahBlah} = "Jack" "Jack
" }{ IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack
" }

--

Graham Mayor - Word MVP

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



Yve Ke wrote:
Thanks for the advice about getting rid of the then...else but it
still isn't working. I want to do the following produce a list (sort
of) { IF { MERGEFIELD Blah } = "Jack" "Jack" }
{ IF { MERGEFIELD BlahBlah} = "Jack" "Jack" }
{ IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack" " }
But if it isn't satsiafied it will give me a blank line which I don't
want Hope you can help

Yve


"Doug Robbins - Word MVP" wrote:

Do it like this:

{ IF { MERGEFIELD MiddleName } = "" "{ MERGEFIELD LastName }" "{
MERGEFIELD MiddleName } { MERGEFIELD LastName }" }

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

"Yve Ke" wrote in message
...
I would like to insert a series of if then else word fields into a
mail merge
letter but if they are not satisified i want the whole thing
suppressed rather than have a space devoted to it. I guess it is
something that you have to do with switches but not sure how. Any
help appreciated.

Yve



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Yve Ke Yve Ke is offline
external usenet poster
 
Posts: 23
Default if...then...else

Thanks this is much better and suppresses empty fields BUT now I am getting
the spaces at the end - the list is quite long with, say, 10 lines but if
there are only a couple that is all the space I want devoted to it
Yve

"Graham Mayor" wrote:

That's because you have your Blahs and Jacks in the wrong places. They need
to go on the same line and the line feed needs to be included between the
quotes.

{ IF { MERGEFIELD Blah } = "Jack" "Jack
" }{ IF { MERGEFIELD BlahBlah} = "Jack" "Jack
" }{ IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack
" }

--

Graham Mayor - Word MVP

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



Yve Ke wrote:
Thanks for the advice about getting rid of the then...else but it
still isn't working. I want to do the following produce a list (sort
of) { IF { MERGEFIELD Blah } = "Jack" "Jack" }
{ IF { MERGEFIELD BlahBlah} = "Jack" "Jack" }
{ IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack" " }
But if it isn't satsiafied it will give me a blank line which I don't
want Hope you can help

Yve


"Doug Robbins - Word MVP" wrote:

Do it like this:

{ IF { MERGEFIELD MiddleName } = "" "{ MERGEFIELD LastName }" "{
MERGEFIELD MiddleName } { MERGEFIELD LastName }" }

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

"Yve Ke" wrote in message
...
I would like to insert a series of if then else word fields into a
mail merge
letter but if they are not satisified i want the whole thing
suppressed rather than have a space devoted to it. I guess it is
something that you have to do with switches but not sure how. Any
help appreciated.

Yve






  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default if...then...else

The construction does not add any lines unless there is content in the
fields. These fields all go on the same line, immediately after and on the
same line as the field they follow. The next field goes immediately after
the construction.

Essentially you have

{Mergefield afield { IF { MERGEFIELD Blah } = "Jack" "Jack
" }Continue here

If there is nothing in the field Blah you get

{Mergefield afield} Continue here


--

Graham Mayor - Word MVP

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


Yve Ke wrote:
Thanks this is much better and suppresses empty fields BUT now I am
getting the spaces at the end - the list is quite long with, say, 10
lines but if there are only a couple that is all the space I want
devoted to it
Yve

"Graham Mayor" wrote:

That's because you have your Blahs and Jacks in the wrong places.
They need to go on the same line and the line feed needs to be
included between the quotes.

{ IF { MERGEFIELD Blah } = "Jack" "Jack
" }{ IF { MERGEFIELD BlahBlah} = "Jack" "Jack
" }{ IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack
" }

--

Graham Mayor - Word MVP

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



Yve Ke wrote:
Thanks for the advice about getting rid of the then...else but it
still isn't working. I want to do the following produce a list
(sort of) { IF { MERGEFIELD Blah } = "Jack" "Jack" }
{ IF { MERGEFIELD BlahBlah} = "Jack" "Jack" }
{ IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack" " }
But if it isn't satsiafied it will give me a blank line which I
don't want Hope you can help

Yve


"Doug Robbins - Word MVP" wrote:

Do it like this:

{ IF { MERGEFIELD MiddleName } = "" "{ MERGEFIELD LastName }" "{
MERGEFIELD MiddleName } { MERGEFIELD LastName }" }

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

"Yve Ke" wrote in message
...
I would like to insert a series of if then else word fields into a
mail merge
letter but if they are not satisified i want the whole thing
suppressed rather than have a space devoted to it. I guess it is
something that you have to do with switches but not sure how. Any
help appreciated.

Yve



Reply
Thread Tools
Display Modes

Posting Rules

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

Forum Jump


All times are GMT +1. The time now is 08:09 PM.

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"