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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail Merge empty fields

Status
Not open for further replies.

dawnd3

Instructor
Jul 1, 2001
1,153
US
How do I eliminate a blank line if a field is empty in a mail merge. (i.e. The person doesn't have a company name) How do I get rid of that space? (Word and Publisher 2003)

Thank you,

Dawn

 
Hi dawnd3,

You could incorporate an IF test into your mailmerge fields.
To do this:
. make a copy of the company mergefield, and paste it alongside the existing one, so
Code:
«Company»«Company»
. select both fields and press Ctrl-F9 to wrap a new field around them, so
Code:
{«Company»«Company»}
. type an If test into the new field, so that the coding ends up as
Code:
{IF«Company» = "" "" "«Company»¶
"}
Note the paragraph (or line feed) mark within the field.
. press F9 to update the field
. delete the existing paragraph (or line feed) mark after your current mergefield.
. run your mailmerge.

Cheers


[MS MVP - Word]
 
hi Dawn,

No idea with Publisher, sorry, but you might check whether it's mailmerge facility includes a 'suppress blank fields' facility. Word does - when you execute the merge it offers the option to 'Don't print blank lines when data fields are empty'. In theory, this should have allowed you to avoid blank lines in your Word document without the need for the field coding solution I posted.

Cheers

[MS MVP - Word]
 
dawnd3, try adding the variable data inside a rectangle. I just tested a file with multiple blanks and the data flows up and down getting rid of empty spaces.

Hope it helps.






Thanks
- Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top