Reply
 
Thread Tools Display Modes
  #1   Report Post  
S Cocke
 
Posts: n/a
Default How do I add a space in a line if a merge field is blank?

I'm trying to merge a doc that has names, some with maiden names and some
without. I want the merge to go first(space)maiden(space)last UNLESS there
is no maiden name, in which case I only need ONE space.

Any ideas?
  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

Use and If...Then...Else field that checks to see if the maiden field is
blank and if it is not, enters the maiden followed by a space, otherwise, it
inserts nothing.

{ IF { MERGEFIELD "maiden" } "" "{ MERGEFIELD "maiden" } " "" }

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"S Cocke" S wrote in message
...
I'm trying to merge a doc that has names, some with maiden names and some
without. I want the merge to go first(space)maiden(space)last UNLESS
there
is no maiden name, in which case I only need ONE space.

Any ideas?



  #3   Report Post  
Karen Hart
 
Posts: n/a
Default

Karen:
Use the IF statement from the INSERT WORD FIELD menu after your MAIDEN
field:
{IF {MERGEFIELD Maiden} "" " " ""}
translates: If maiden is not blank, put a space here. Otherwise, put no
space.
Karen Hart

"S Cocke" S wrote in message
...
I'm trying to merge a doc that has names, some with maiden names and some
without. I want the merge to go first(space)maiden(space)last UNLESS
there
is no maiden name, in which case I only need ONE space.

Any ideas?



  #4   Report Post  
S Cocke
 
Posts: n/a
Default

Thanks. This may sound dense, but can you give me a step by step?

In the word doc, I have firstname maiden last

So, do I insert the IF...THEN function after I insert maiden or before?


Also, in the IF...THEN dialog box, where do I put the string that you gave
me? Do I enter If maiden is blank and then enter the string in the
"insert this text" box?

THANKS,
Shannon

"Doug Robbins" wrote:

Use and If...Then...Else field that checks to see if the maiden field is
blank and if it is not, enters the maiden followed by a space, otherwise, it
inserts nothing.

{ IF { MERGEFIELD "maiden" } "" "{ MERGEFIELD "maiden" } " "" }

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"S Cocke" S wrote in message
...
I'm trying to merge a doc that has names, some with maiden names and some
without. I want the merge to go first(space)maiden(space)last UNLESS
there
is no maiden name, in which case I only need ONE space.

Any ideas?




  #5   Report Post  
Doug Robbins
 
Posts: n/a
Default

Type

MERGEFIELD "maiden"

then select it and press Ctrl + F9. You should now see

{ MERGEFIELD "maiden" }

Do this again so that you have

{ MERGEFIELD "maiden" }{ MERGEFIELD "maiden" }

Now add the IF, the "" " etc. so that you have

IF { MERGEFIELD "maiden" } "" "{ MERGEFIELD "maiden" } " ""

Don't forget the space after the second { MERGEFIELD "maiden" } before the
closing quote

Now select all of that and press Ctrl + F9 which should give you

{ IF { MERGEFIELD "maiden" } "" "{ MERGEFIELD "maiden" } " "" }

Now press Alt+F9 to toggle off the field codes and then execute your merge.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"S Cocke" wrote in message
...
Thanks. This may sound dense, but can you give me a step by step?

In the word doc, I have firstname maiden last

So, do I insert the IF...THEN function after I insert maiden or
before?


Also, in the IF...THEN dialog box, where do I put the string that you gave
me? Do I enter If maiden is blank and then enter the string in the
"insert this text" box?

THANKS,
Shannon

"Doug Robbins" wrote:

Use and If...Then...Else field that checks to see if the maiden field is
blank and if it is not, enters the maiden followed by a space, otherwise,
it
inserts nothing.

{ IF { MERGEFIELD "maiden" } "" "{ MERGEFIELD "maiden" } " "" }

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a
paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"S Cocke" S wrote in message
...
I'm trying to merge a doc that has names, some with maiden names and
some
without. I want the merge to go first(space)maiden(space)last UNLESS
there
is no maiden name, in which case I only need ONE space.

Any ideas?






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
How to print blank merge data as a blank line? YYS Mailmerge 1 January 17th 05 12:18 PM
Retaining formatting on a single line after entering data in field snidely Page Layout 1 January 17th 05 01:29 AM
Home Phone field not getting picked up in Merge Cathleen McGuire Mailmerge 4 January 7th 05 03:13 AM
suppress invalid merge field word 2003 Mike Mailmerge 3 December 9th 04 11:13 AM
How do I keep a blank line from printing in a mail merge? Record. Kellye Mailmerge 1 December 8th 04 12:50 AM


All times are GMT +1. The time now is 05:03 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"