Link to home
Start Free TrialLog in
Avatar of thechrisrobertstoo
thechrisrobertstoo

asked on

Word Mailmerge: How to only include carriage returns if a field returns text

I have a pretty standard mailmerge document that uses an excel file as a source document.  I know how to include text after a valid entry (like a space for example) by right mouse clicking on the field and choosing 'Edit Field', then ticking the 'Text to be inserted after' checkbox and then adding the text I want.

What I want with this current file is to add an extra carriage return or line break to separate field entries, but only when each field actually has data.

Can I do this?
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

By default, if you put a carriage return immediately after the merge field, it will not appear in the output if the field is empty.
Avatar of thechrisrobertstoo
thechrisrobertstoo

ASKER

Ah, yes, you're right.  But I want to make the space an actual line break - but only when there is an entry.  I thought that I could just amend the paragraph formatting, but it then applies it even when there is no entry in the mailmerge field.

So, to clarify, I want to ensure a clear single line space between each mailmerge field, but only when they contain some actual text.
Sorry. Been out all day & evening.

in Word, if you press the {Enter} key, it creates a  paragraph mark. The following paragraph always starts on a new line, though spacing depends on the Paragraph properties which are derived, in the first instance, from the paragraph style.

It might help to show the formatting marks with the Show/Hide(¶) toggle on the Home tab. The pilcrow symbol (¶) is how the paragraph mark is represented when the formatting marks are showing.
Thanks for your comment.  I am aware of the paragraph marks and have changed the paragraph formatting to include a 12 point space after the paragraph, which, logically should mean that these spaces are only applied when data is present, as per your earlier point, but this isn't what is actually happening.  I get the spaces even when no information is showing.  I take your point that I ought to examine how many paragraph marks are showing on the output document.  It could be that some of the fields are outputting spaces or something as their contents.  I will check this out and let you know.
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial