Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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 | |
|
|
![]() |
||||
Thread | Forum | |||
Carriage Return Help | Mailmerge | |||
Carriage Return | Microsoft Word Help | |||
Mergefield - carriage return | Mailmerge | |||
Carriage Return in Mid-sentence | Microsoft Word Help | |||
Search and replace hard-line-return character, not carriage return | Microsoft Word Help |