A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Carriage Return Help



 
 
Thread Tools Display Modes
  #1  
Old April 2nd, 2010, 07:31 PM posted to microsoft.public.word.mailmerge.fields
UCHelp
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  
Old April 2nd, 2010, 09:35 PM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
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  
Old April 5th, 2010, 06:08 AM posted to microsoft.public.word.mailmerge.fields
UCHelp[_3_]
external usenet poster
 
Posts: 1
Default Carriage Return Help


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
  #4  
Old April 5th, 2010, 10:49 PM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:05 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.