View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Carriage Return Help

If you are using an ADDRESSBLOCK field, you are stuck with what it does,
and you should probably change to using the individual fields that you need.

If you are using individual fields, you can do, e.g.

{ MERGEFIELD "contact.address1"
}{ IF { MERGEFIELD "contact.address2" } "" "
{ MERGEFIELD "contact.address2" }" "" }
whatever text you need on the next line

Peter Jamieson

http://tips.pjmsn.me.uk

On 02/04/2010 19:31, UCHelp wrote:
Hello. I am using a format that imports data through XML Word Documents.

The format is {entity.attribute}

for example
{contact.fullname}
{contact.company}
{contact.address1}
{contact.address2}

My problem is, if the contact doesn't have an address 2 line, it will merge
an unwanted carriage return.

How can I make sure this doesn't happen by checking if the line is empty and
thus not putting a carriage return? Many contacts dont have address line 2s,
but some do.