Eliminating spaces in merged documnents

J

johnsoned

I am merging names and addresses from an excel document to several different
word documents. I set up the excel file with a separate field for middle
name/initial. When a name without a middle name/initial prints there are two
spaces between the first and last name. What could be done to fix this other
than getting rid of the middle name/initial field and adding this information
to the first name field.
 
G

Graham Mayor

Use a conditional field to place the initial and its leading space when
there is content eg

{IF {Mergefield Initial} <> "" " {Mergefield Initial}"}


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

johnsoned

If I knew what I was doing, the answer you gave me would probably work, but I
must be missing something. When I edit the field-code, instead of the middle
name or just a space, I get {IF G.<> "" "G."} or {IF<>"" " "} where the
middle name/initial should be when I merge the Word document. Can you tell me
what am I doing wrong?
 
G

Graham Mayor

I believe Greg has identified half the problem. the other half is that you
may have typed {} from the keyboard instead of using CTRL+F9 to set the
field boundaries. If you use CTRL+F9 for each pair and type the rest
directly (substituting your data field names as appropriate) you should find
that it works. Don't forget to include the space between the speech marks of
the result.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

johnsoned

I swear that I have followed the instructions you gave me to the letter. I
didn't know about using CTRL+F9 to make each set of brackets. So I was sure
that everything would fall into place once I did that, but after typing the
correct information between each set of brackets, I still have my original
problem (two spaces between the first name and last name when no middle
name/initial is present). I even tried eliminating all of the spaces within
the brackets for the middle name field code to no avail.
 
G

Graham Mayor

If you followed the instructions to the letter, you will have no space
unless the space is included in the data itself. However, let's include the
fields on either side for the sake of clarification:

{Mergefield First_Name}{IF {Mergefield Initial} <> "" " {Mergefield
Initial}"} {Mergefield Last_Name}
or
{Mergefield First_Name}no space{IF {Mergefield Initial} <> ""
"space{Mergefield Initial}"}space{Mergefield Last_Name}


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

That's a relief ;)

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top