Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
UCHelp[_2_] UCHelp[_2_] is offline
external usenet poster
 
Posts: 1
Default Carriage Return Help

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.

  #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.

  #3   Report Post  
UCHelp UCHelp is offline
Junior Member
 
Posts: 5
Default

Thanks for the reply. Sorry for the double-post, guess my connection got held up somewhere.

The thing about this is, I need this exact string to be untouched {contact.address1}, etc. That is to say, if anything is between any of the characters of {contact.address1}, the merge will not work. Is there a way to keep it untouched, while within a field?

And if it is in this field, is there something that I can put in the field that executes a carriage return if data is merged?

So if I have
{contact.address1} {contact.address2}
on the same line, then the address 1 field, if it merges data and is NOT null, it will merge data as well as the carriage return?

and if address 2 is NULL for example, it will not post anything? so it will be address1 followed by a carriage return, followed by whatever else is in the letter? disregarding the fact that I even tried to merge address2
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Carriage Return Help

Use:

{ MERGEFIELD "contact.address1"}{ IF { MERGEFIELD "contact.address2" } ""

{ MERGEFIELD "contact.address2" }" "" }

Where the ¶ appears in the above field construction press the Enter key, or
Shift+Enter if your paragraphs are formatted to have space after or before
them


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"UCHelp" wrote in message
...

Thanks for the reply. Sorry for the double-post, guess my connection got
held up somewhere.

The thing about this is, I need this exact string to be untouched
{contact.address1}, etc. That is to say, if anything is between any of
the characters of {contact.address1}, the merge will not work. Is there
a way to keep it untouched, while within a field?

And if it is in this field, is there something that I can put in the
field that executes a carriage return if data is merged?

So if I have
{contact.address1} {contact.address2}
on the same line, then the address 1 field, if it merges data and is
NOT null, it will merge data as well as the carriage return?

and if address 2 is NULL for example, it will not post anything? so it
will be address1 followed by a carriage return, followed by whatever
else is in the letter? disregarding the fact that I even tried to merge
address2




--
UCHelp


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Carriage Return Help UCHelp Mailmerge 1 April 2nd 10 09:35 PM
Carriage Return steve_ben Microsoft Word Help 1 March 1st 09 02:11 PM
Mergefield - carriage return Eric Mailmerge 3 March 27th 08 09:19 PM
Carriage Return in Mid-sentence Ride the Rockies Microsoft Word Help 1 March 17th 08 08:48 PM
Search and replace hard-line-return character, not carriage return Tyler T Microsoft Word Help 2 August 16th 06 09:11 PM


All times are GMT +1. The time now is 03:17 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"