NewDeal Hot Tip 1903

[Hot Tips for...] NewWrite

Conditional Mail Merge

A customer asks:

I have a NewFile database that I use for merging business contacts into NewWrite documents. The problem is that in some records I need an entry in the field for Position while other records (in the same database) that are merged into the same NewWrite document do not have an entry for Position. If I leave the "position" field blank in those records in which it is not applicable, the result in the merged document is a blank line in the address line.

Is there a way to configure the documents so that Position will be merged into the document when applicable while not resulting in a blank line when it is not?

A NewDeal guru answers:

Here's one way to do it.

Let's say you have these fields in your database:

NAME
POSITION
STREET
CITY
STATE
ZIP
You want the address to show up like this in your mail merge when there is a position in the record:
NAME
POSITION
STREET
CITY, STATE ZIP
And you want it to look like this if there's no position in the record:
NAME
STREET
CITY, STATE ZIP
In NewFile, add a carriage return to the beginning of the POSITION field whenever there is data in the POSITION field for the record. You do so by pressing CTRL+SHIFT+ENTER.

In other words, let's say that Susie's position is Vice-President. In the POSITION field for Susie's record you would locate the insertion point before the "V" in "Vice" and then you press SHIFT+CTRL+ENTER to put a blank line in the field. You do NOT put a blank line in the POSITION fields in the records where the POSITION field has no data.

Change your merge document in NewWrite to look like this:

«NAME»«POSITION»
«STREET»
«CITY», «STATE» «ZIP»
Now, when you merge, the POSITION prints out on its own line between NAME and STREET, but there is no extra line for the records that have no POSITION.
Return to Index

Last Modified 7 Mar 1999