Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Michelle
 
Posts: n/a
Default If then else question

Can somebody help me with the correct syntax for the following:

If NAME2 is blank
Then NAME1description + ",and"
Else NAME1description
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default If then else question

{ 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



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Michelle
 
Posts: n/a
Default If then else question

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

  #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



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Michelle
 
Posts: n/a
Default If then else question

That was the first thing I tried - the result was spaces before the comma
like this:

JOHN SMITH, an individual; MARY SMITH, an individual ,and


"Doug Robbins - Word MVP" wrote:

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.




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

You must have some uneeded spaces in the field construction some where.

--
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
...
That was the first thing I tried - the result was spaces before the comma
like this:

JOHN SMITH, an individual; MARY SMITH, an individual ,and


"Doug Robbins - Word MVP" wrote:

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.




Reply
Thread Tools
Display Modes

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Be nice if your suggested answers fit the question. Harvey Eastman Microsoft Word Help 3 April 20th 06 02:59 PM
Exam question wrong about Word? Opinions, please! Jamie Furlong New Users 6 April 18th 06 11:56 AM
"Save document" question! billybob New Users 2 March 20th 06 06:32 AM
AutoRecovery Question Thomas M Microsoft Word Help 6 July 26th 05 02:50 AM
Newbie document question please Dudley Henriques New Users 4 January 9th 05 08:38 PM


All times are GMT +1. The time now is 07:38 AM.

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"