View Single Post
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default If then else question

If you always need ", and" after the last name, do not make it part of the
mergefield construction. Simply have it as text in the document.

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

"Michelle" wrote in message
...
Thanks for your prompt reply, but unfortunately, I now understand this is
not
the result I want, after all. I have 5 mergefields for names ("John
Smith",
etc) and 5 merge fields for descriptions ("an individual") but don't know
in
advance how many the record will actually contain.

This is what I got using your suggestions:
JOHN SMITH, an individual
MARY SMITH, an individual
an individual, and
an individual, and
an individual, and
an individual, and

Here's the result I really need:
JOHN SMITH, an individual
MARY SMITH, an individual, and

So, I always need ", and" after the last name.

Is there a way to do this? Sorry about my confused mind!



"Doug Robbins - Word MVP" wrote:

{ IF { MERGEFIELD NAME2 } = "" "{ MERGEFIELD NAME1description }, and " "{
MERGEFIELD NAME1descript }" }

You must use Ctrl+F9 to insert each pair of field delimiters { } and
Alt+F9
to toggle 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

"Michelle" wrote in message
...
Can somebody help me with the correct syntax for the following:

If NAME2 is blank
Then NAME1description + ",and"
Else NAME1descript