Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Supressing blank fields in mailmerge!!

Status
Not open for further replies.

StressedTechie

Technical User
Jul 13, 2001
367
GB
I have a word mail merge pulling data from an excel spredsheet. All is working well except when a field contains no data it leaves the field blank. For Instance.

I have the following address fields.

{mergefield "Client_Name"}
{mergefield "AddressDetail"}
{mergefield "City"}
{mergefield "County"}
{mergefield "Country"}
{mergefield "Postcode"}

Now some of my clients dont have a City name wen I view the merged data I get the following

Client_Name
AddressDetail

County
Country
Postcode

I have checked the Mail Merge Helper and it is set to surpress any blank fields but it doesnt seem to be doing it.

Any ideas

Cheers
S T
 
Are you sure the cells are indeed blank? Could there be invisible characters in there?

 
What version of Word?

Mail Merge has changed over the last few versions.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Word 2003 It supposedto automaically remove blank fields but it isnt
 
So you saw the 'skip blank fields' (I don't recall the exact wording off the top of my head) checkbox, checked it, and you are still getting blank lines in the address?

All I can think of is that the fields in Excel aren't really blank, like Lilliabeth suggested.

Try this: In excel, in an unused column, type in [COLOR=blue white]=len([attn]X[/attn]2)[/color] where [attn]X[/attn] is the column containing the City.

Drag the formula down as far as you have data.

Make sure that for all rows where the City is blank that the formula shows zero.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 

This is a problem in Word 2003 - it doesn't work the same way as before. You need to use the old Merge dialog to make it work properly.

You can use the full Mail Merge Helper but what I prefer is to use the new Task Pane dialogs but, for the actual Merge use the old button.

Tools > Customize > Commands tab
Select All Commands on the left
Scroll down the right and Click and Drag "MailMerge" to the Mail Merge toolbar.

When you're ready to Merge, use this button (labeled "Merge...") instead of all the other icons. Then you'll get the dialog with the option to suppress blank lines.


Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Thanks for all your assistance I finally managed to fix it. After trawling through hundreds of technet docs and microsoft support forums the following tiny little note of information sprung forth!!!

NOTE: Each line must end with a paragraph mark (¶) in order for Word to suppress the line, if the result of the MERGEFIELDS is blank. If the line ends with a New Line character, Word is unable to suppress a blank line.

Thanks everyone
"Not so" Stressed "Now" Techie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top