How do I prevent non-breaking spaces or blank fields during a Mer.

N

nettedavid

When I toggle my field codes to view my data during a mail merge using a Word
table data source, I receive blank lines where there are empty fields. The
data comes from an Excel spreadsheet (which can't be used as a data source
because of our document management program), and each piece of data is a
separate field. I've tried using \b and \f switches to add space if the next
field has data, but when I toggle the codes the switches disappear. How
can I prevent the empty field spaces? An example of a switch would be:
«Client_1_FirstName \b " " ». Do I have the syntax wrong? Any help would be
greatly appreciated. Thanks!
 
N

nettedavid

I forgot to add the first part: Two of my fields are:
{MERGEFIELD Client_1_Prefix}{MERGEFIELD Client_1_First \f " "}
 
G

Graham Mayor

A couple of issues here - you need to toggle the field code to add switches
so assuming yours is correct (and I haven't checked) then the correct syntax
would be {Mergefield Client_1_FirstName \b " " } Toggle back and the display
should be «Client_1_FirstName»

Personally I prefer to use the brute force method of conditional fields to
insert data and the associated spaces or line feeds

{IF{Mergefield Client_1_FirstName} <> "" "
{Mergefield Client_1_FirstName} "}{Mergefield Client_1_LastName}

Here the construction checks for content and if there is any it moves down a
line and inserts first name and a space. The lastnamke field follows
immediately without a space. This method is easy to adapt to your
requirements and better still you can see what is happening and why. Use
CTRL+F9 to insert field boundaries {} when building the conditional fields
manually.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
N

nettedavid

Thanks, Graham. I tried both ways - but when I toggled the field codes to
see the data and then toggled back to view the field codes I lost the
conditional field codes that I put in. Is it supposed to do that? I have
several fields to put conditional formatting in and it appears as though I
can't check the data to see if it works without losing the codes.
 
G

Graham Mayor

ALT+F9 will toggle the display and yes some of the field construction
information will 'disappear' when you toggle back (though if you click the
<<ABC>> button on the merge toolbar
(http://www.gmayor.com/mail_merge_labels_with_word_xp.htm ) you can view
the resulting data and step through the records to ascertain if the result
is what you intended.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
N

nettedavid

It works now, thanks!

Graham Mayor said:
ALT+F9 will toggle the display and yes some of the field construction
information will 'disappear' when you toggle back (though if you click the
<<ABC>> button on the merge toolbar
(http://www.gmayor.com/mail_merge_labels_with_word_xp.htm ) you can view
the resulting data and step through the records to ascertain if the result
is what you intended.

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