View Single Post
 
Old 11-13-2011, 04:52 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Welshie82,

There are two mergefield switches you can use for this:
\b - Specifies the text to be inserted before the MERGEFIELD field if the field is not blank.
\f - Specifies the text to be inserted following the MERGEFIELD field if the field is not blank.

For example, suppose your mergefield is «Data». Selecting the field and pressing Shift F9 will reveal:
{MERGEFIELD Data}
If you code the mergefield as:
{MERGEFIELD Data \b "¶
"}
(where ¶ is a pargraph break) it will insert a paragraph break before the mergefield if the field is not blank. Conversely, if you code the mergefield as:
{MERGEFIELD Data \f "¶
"}
it will insert the paragraph break after the mergefield if the field is not blank.

So, instead of having:
«Prefix» «Firstname» «Lastname»
«Organisation»
«Address1»
«Address2»
«Address3»
«Address4»
«City»
«County»
«Postalcode»
«Country»
you might add the \b switch to the «Organisation», «Address2», «Address3», «Address4», «County» & «Country» fields and lay them out as:
«Prefix» «Firstname» «Lastname»«Organisation»
«Address1»«Address2»«Address3»«Address4»
«City»«County»
«Postalcode»«Country»
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote