Suppressing Blank Fields

C

Chris

Hi all-

I recently created a form letter and associated data file. I have placed
the address fields I required into my letter as follows:

«Title» «FirstName» «LastName»
«Company»
«Address1»
«Address2»
«City», «State» «PostalCode»

Here is where I have a question. In the majority of cases, the <<Address
2>> field in the data source will not contain any information. I seem to
remember that there is a setting which allows you to collapse lines when an
address field like this is blank. I tried digging around for such a
feature, and have checked the help file, but I cannot figure out how to
accomplish this. As a result, addresses without an <<Address 2>> value
appear with a blank line where <<Address 2>> would otherwise appear, as
shown in the following example:

P. Diddy
Diddy Records, Inc.
100 Diddy Drive

Diddyville, DY 10101

This doesn't look good, and I'd like to fix it.

Any help would be greatly appreciated.

Best regards,
Chris
 
P

Paul Berkowitz

I recently created a form letter and associated data file. I have placed
the address fields I required into my letter as follows:

«Title» «FirstName» «LastName»
«Company»
«Address1»
«Address2»
«City», «State» «PostalCode»

Here is where I have a question. In the majority of cases, the <<Address
2>> field in the data source will not contain any information. I seem to
remember that there is a setting which allows you to collapse lines when an
address field like this is blank. I tried digging around for such a
feature, and have checked the help file, but I cannot figure out how to
accomplish this. As a result, addresses without an <<Address 2>> value
appear with a blank line where <<Address 2>> would otherwise appear, as
shown in the following example:

P. Diddy
Diddy Records, Inc.
100 Diddy Drive

Diddyville, DY 10101

This doesn't look good, and I'd like to fix it.

Any help would be greatly appreciated.


You need to use the "If...Then...Else" field from Word Fields in the Data
Merge Manager, and then play with the result. First read up on Data Merge in
the Help, and follow all the links to IF fields there. To fill it out, this
is what you'll be doing. (You could also do this with «Title» to avoid the
space if there's no title.)

When you get to the point that you've entered

«Address1»

don't type the Return key. Open the "Word Field" triangle in the DMM and
drag the "IfŠThenŠElseŠ" field to that location (after the »). A window will
open up that has text fields and popups and looks like this:

If
Field name: Comparison: Compare to:
<First_Name> <Is equal to> [ ]

Insert this text:
[ ]

Otherwise insert this text:
[ ]

where < > is a popup and [ ] is an empty text field. The first popup
will be showing the name of your first data field.

Flip the Field name popup to <Address2>.
Flip the Comparison popup to <Is not equal to>
Leave the [Compare to] field empty.
Insert anything as a placeholder, e.g. "aa" (without quotes) into the
[Insert this text] box.
Leave the [Otherwise] box empty.
Close the window.

At this point, it will look as if you've done nothing: nothing appears in
the document. Don't worry. NOW type a Return and carry on with «City», etc.

When you've done the last line, go down to the "Preview" panel in the DMM.
At the far right you'll see a {a} button, with the tooltip "View Field
Codes". Press it. Or press Option-9 instead, which does the same thing.
You'll now see all the field codes, which look like { MERGEFIELD First_Name
}, except they're special brackets, you can't type them. Where you had
dragged the IfŠThenŠElse field, just after the «Address1» field, you'll
suddenly see this:

{ MERGEFIELD Address1 }{ IF { MERGEFIELD Address2 <> "" } "aa" ""}

That shows the field codes for the IF field you entered, complete with "aa"
placeholder, following the Address1 field code.

Select and copy the

{ MERGEFIELD Address1 }

section. Then select just the aa placeholder between (not including) the " "
quotes around it, and paste to replace the placeholder. So now it will look
like this:

{ MERGEFIELD Address1 }{ IF { MERGEFIELD Address2 <> "" } "{ MERGEFIELD
Address1 }" ""}


but all on one line (the plain text email breaks it here unfortunately).
Change the Address1 you just pasted in to Address2, and type a Return just
between the " quote preceding its own preceding { MERGEFIELD bracket. So it
now looks like this:


{ MERGEFIELD Address1 }{ IF { MERGEFIELD Address2 <> "" } "
{ MERGEFIELD Address2 }" ""}


(That looks exactly as if should. Notice the correct line break just after
the " quote preceding the { MERGEFIELD Address2 }" on the new line. It's now
saying, in code, that if the Address2 field is not empty ( <> ""), enter the
Address2 field, otherwise enter nothing ("").

Now click the {a} button again (or press Option-9 again) in Preview to
toggle the field codes off. Again, the whole IF field disappears. If you
wish, you can now press the « »ABC button at the left of the Preview panel.
You'll see how the first record will appear. By clicking the > right arrow
a few times you can see how subsequent records will appear, so you can check
for records that have and don't have Address2.

Then do your merge and it should be fine.


--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
 

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