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

Word and Mail Merge

Status
Not open for further replies.

Malc8179

MIS
Oct 8, 2007
28
GB
Hi Guys

I have a merged document that contains nulls each line is a link to a address field

Strand Consulting Ltd
50 Essex Street
NULL
NULL
London
NULL
WC2R 3JF

any ideas on how if the the field contains null how i can move the next field in so the data should look like

Strand Consulting Ltd
50 Essex Street
London
WC2R 3JF


 
I can't tell from the question if you are in a merged document or if you are in process of a merge and "each line is a link to an address field".

If the merge is complete and that is the final output that you have, turn on your non-prints to see what character is at the end of each NULL (is it a line break or an end of paragraph?... probably end of paragraph)

Now use the Replace command to replace NULL and that character. Leave the "Replace With" box empty.

For example, if the character is an end of paragraph, Put this in the "Find What" box: NULL^p
"Replace With": Leave this empty

--Lilliabeth
 
Hi Malc8179,

A better option for future mailmerges is to use the 'suppress blank lines' option or, if your mailmerge actually outputs 'NULL' to apply an IF test to the fields. To do this in Word-
. duplicate the mailmerge field to be suppressed when it outputs 'NULL' (eg «MyData») so that you get:
«MyData»«MyData»;
. select both fields and Press Ctrl-F9, you'll get:
{ «MyData»«MyData» };
. fill in between the braces so that you end up with:
{IF«myData»= "NULL" "" "«MyData»¶
"},
where the '¶' is a paragraph mark or line-feed, depending on which you're using
. delete the existing paragraph mark or line-feed that's outside the mergefield;
. position the cursor anywhere in this field and press F9 to update it;
. run your mailmerge.

Cheers


[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top