Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / September 2006

Tip: Looking for answers? Try searching our database.

if...then...else

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Yve Ke - 02 Sep 2006 01:31 GMT
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
Doug Robbins - Word MVP - 02 Sep 2006 08:21 GMT
Do it like this:

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

Signature

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

>I would like to insert a series of if then else word fields into a mail
>merge
[quoted text clipped - 3 lines]
>
> Yve
Yve Ke - 03 Sep 2006 05:04 GMT
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

> Do it like this:
>
[quoted text clipped - 8 lines]
> >
> > Yve
Graham Mayor - 03 Sep 2006 06:24 GMT
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
" }

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

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

> 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
[quoted text clipped - 27 lines]
>>>
>>> Yve
Yve Ke - 04 Sep 2006 07:04 GMT
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

> 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
[quoted text clipped - 36 lines]
> >>>
> >>> Yve
Graham Mayor - 04 Sep 2006 07:16 GMT
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

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

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

> 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
[quoted text clipped - 50 lines]
>>>>>
>>>>> Yve
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.