Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Problems with IF statement
Hello,
I am attempting to cater for a blank address2 in a mail merge. I have written the following expression: { MERGEFIELD Title } { MERGEFIELD FristName } { MERGEFIELD LastName } { MERGEFIELD Addr1 } { IF { MERGEFIELD Addr2 } = "" "" "{ MERGEFIELD Addr2 } " }{ MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode } The intention is to enter Addr2 and a carriage return if Addr2 is not blank. I have two problems with this at the moment: 1. The carriage return is not working 2. If the text for Addr2 is "Level 21" only 21 is being displayed. I have included the spaces in the IF statement as it appears in my doc. Can someone point out where I have gone wrong? I am using Word 2003 Thanks in advance |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Problems with IF statement
{ MERGEFIELD Title } { MERGEFIELD FirstName } { MERGEFIELD LastName }
{ MERGEFIELD Addr1 }{ IF { MERGEFIELD Addr2 } "" " { MERGEFIELD Addr2 }" } { MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Joe Di Giulio wrote: Hello, I am attempting to cater for a blank address2 in a mail merge. I have written the following expression: { MERGEFIELD Title } { MERGEFIELD FristName } { MERGEFIELD LastName } { MERGEFIELD Addr1 } { IF { MERGEFIELD Addr2 } = "" "" "{ MERGEFIELD Addr2 } " }{ MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode } The intention is to enter Addr2 and a carriage return if Addr2 is not blank. I have two problems with this at the moment: 1. The carriage return is not working 2. If the text for Addr2 is "Level 21" only 21 is being displayed. I have included the spaces in the IF statement as it appears in my doc. Can someone point out where I have gone wrong? I am using Word 2003 Thanks in advance |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Problems with IF statement
Thank you.
This worked however if address2 is blank it shows this: Bob and Jane Smith 12 Microsoft Street New York Whereas I want it to put the new york line on the address2 line if blank like this: Bob and Jane Smith 12 Microsoft Street New York. So could you tell me how to modify the if statement to do this? Regards Briza "Graham Mayor" wrote: { MERGEFIELD Title } { MERGEFIELD FirstName } { MERGEFIELD LastName } { MERGEFIELD Addr1 }{ IF { MERGEFIELD Addr2 } "" " { MERGEFIELD Addr2 }" } { MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Joe Di Giulio wrote: Hello, I am attempting to cater for a blank address2 in a mail merge. I have written the following expression: { MERGEFIELD Title } { MERGEFIELD FristName } { MERGEFIELD LastName } { MERGEFIELD Addr1 } { IF { MERGEFIELD Addr2 } = "" "" "{ MERGEFIELD Addr2 } " }{ MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode } The intention is to enter Addr2 and a carriage return if Addr2 is not blank. I have two problems with this at the moment: 1. The carriage return is not working 2. If the text for Addr2 is "Level 21" only 21 is being displayed. I have included the spaces in the IF statement as it appears in my doc. Can someone point out where I have gone wrong? I am using Word 2003 Thanks in advance |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Problems with IF statement
You must put the carriage return exactly where it appears in Graham's post
{ MERGEFIELD Title } { MERGEFIELD FirstName } { MERGEFIELD LastName }¶ { MERGEFIELD Addr1 }{ IF { MERGEFIELD Addr2 } "" "¶ { MERGEFIELD Addr2 }" }¶ { MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode -- 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 "Briza" wrote in message ... Thank you. This worked however if address2 is blank it shows this: Bob and Jane Smith 12 Microsoft Street New York Whereas I want it to put the new york line on the address2 line if blank like this: Bob and Jane Smith 12 Microsoft Street New York. So could you tell me how to modify the if statement to do this? Regards Briza "Graham Mayor" wrote: { MERGEFIELD Title } { MERGEFIELD FirstName } { MERGEFIELD LastName } { MERGEFIELD Addr1 }{ IF { MERGEFIELD Addr2 } "" " { MERGEFIELD Addr2 }" } { MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Joe Di Giulio wrote: Hello, I am attempting to cater for a blank address2 in a mail merge. I have written the following expression: { MERGEFIELD Title } { MERGEFIELD FristName } { MERGEFIELD LastName } { MERGEFIELD Addr1 } { IF { MERGEFIELD Addr2 } = "" "" "{ MERGEFIELD Addr2 } " }{ MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode } The intention is to enter Addr2 and a carriage return if Addr2 is not blank. I have two problems with this at the moment: 1. The carriage return is not working 2. If the text for Addr2 is "Level 21" only 21 is being displayed. I have included the spaces in the IF statement as it appears in my doc. Can someone point out where I have gone wrong? I am using Word 2003 Thanks in advance |
#5
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Problems with IF statement
Thank you but how do I insert a carriage return.
What is the key or key combination in word 2007? "Doug Robbins - Word MVP" wrote: You must put the carriage return exactly where it appears in Graham's post { MERGEFIELD Title } { MERGEFIELD FirstName } { MERGEFIELD LastName }¶ { MERGEFIELD Addr1 }{ IF { MERGEFIELD Addr2 } "" "¶ { MERGEFIELD Addr2 }" }¶ { MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode -- 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 "Briza" wrote in message ... Thank you. This worked however if address2 is blank it shows this: Bob and Jane Smith 12 Microsoft Street New York Whereas I want it to put the new york line on the address2 line if blank like this: Bob and Jane Smith 12 Microsoft Street New York. So could you tell me how to modify the if statement to do this? Regards Briza "Graham Mayor" wrote: { MERGEFIELD Title } { MERGEFIELD FirstName } { MERGEFIELD LastName } { MERGEFIELD Addr1 }{ IF { MERGEFIELD Addr2 } "" " { MERGEFIELD Addr2 }" } { MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Joe Di Giulio wrote: Hello, I am attempting to cater for a blank address2 in a mail merge. I have written the following expression: { MERGEFIELD Title } { MERGEFIELD FristName } { MERGEFIELD LastName } { MERGEFIELD Addr1 } { IF { MERGEFIELD Addr2 } = "" "" "{ MERGEFIELD Addr2 } " }{ MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode } The intention is to enter Addr2 and a carriage return if Addr2 is not blank. I have two problems with this at the moment: 1. The carriage return is not working 2. If the text for Addr2 is "Level 21" only 21 is being displayed. I have included the spaces in the IF statement as it appears in my doc. Can someone point out where I have gone wrong? I am using Word 2003 Thanks in advance |
#6
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Problems with IF statement
Press the enter key where ¶ is shown and nowhere else in the field
construction. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Briza wrote: Thank you but how do I insert a carriage return. What is the key or key combination in word 2007? "Doug Robbins - Word MVP" wrote: You must put the carriage return exactly where it appears in Graham's post { MERGEFIELD Title } { MERGEFIELD FirstName } { MERGEFIELD LastName }¶ { MERGEFIELD Addr1 }{ IF { MERGEFIELD Addr2 } "" "¶ { MERGEFIELD Addr2 }" }¶ { MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode -- 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 "Briza" wrote in message ... Thank you. This worked however if address2 is blank it shows this: Bob and Jane Smith 12 Microsoft Street New York Whereas I want it to put the new york line on the address2 line if blank like this: Bob and Jane Smith 12 Microsoft Street New York. So could you tell me how to modify the if statement to do this? Regards Briza "Graham Mayor" wrote: { MERGEFIELD Title } { MERGEFIELD FirstName } { MERGEFIELD LastName } { MERGEFIELD Addr1 }{ IF { MERGEFIELD Addr2 } "" " { MERGEFIELD Addr2 }" } { MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Joe Di Giulio wrote: Hello, I am attempting to cater for a blank address2 in a mail merge. I have written the following expression: { MERGEFIELD Title } { MERGEFIELD FristName } { MERGEFIELD LastName } { MERGEFIELD Addr1 } { IF { MERGEFIELD Addr2 } = "" "" "{ MERGEFIELD Addr2 } " }{ MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode } The intention is to enter Addr2 and a carriage return if Addr2 is not blank. I have two problems with this at the moment: 1. The carriage return is not working 2. If the text for Addr2 is "Level 21" only 21 is being displayed. I have included the spaces in the IF statement as it appears in my doc. Can someone point out where I have gone wrong? I am using Word 2003 Thanks in advance |
#7
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Problems with IF statement
Use the Enter key
-- 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 "Briza" wrote in message ... Thank you but how do I insert a carriage return. What is the key or key combination in word 2007? "Doug Robbins - Word MVP" wrote: You must put the carriage return exactly where it appears in Graham's post { MERGEFIELD Title } { MERGEFIELD FirstName } { MERGEFIELD LastName }¶ { MERGEFIELD Addr1 }{ IF { MERGEFIELD Addr2 } "" "¶ { MERGEFIELD Addr2 }" }¶ { MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode -- 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 "Briza" wrote in message ... Thank you. This worked however if address2 is blank it shows this: Bob and Jane Smith 12 Microsoft Street New York Whereas I want it to put the new york line on the address2 line if blank like this: Bob and Jane Smith 12 Microsoft Street New York. So could you tell me how to modify the if statement to do this? Regards Briza "Graham Mayor" wrote: { MERGEFIELD Title } { MERGEFIELD FirstName } { MERGEFIELD LastName } { MERGEFIELD Addr1 }{ IF { MERGEFIELD Addr2 } "" " { MERGEFIELD Addr2 }" } { MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Joe Di Giulio wrote: Hello, I am attempting to cater for a blank address2 in a mail merge. I have written the following expression: { MERGEFIELD Title } { MERGEFIELD FristName } { MERGEFIELD LastName } { MERGEFIELD Addr1 } { IF { MERGEFIELD Addr2 } = "" "" "{ MERGEFIELD Addr2 } " }{ MERGEFIELD City } { MERGEFIELD State } { MERGEFIELD Postcode } The intention is to enter Addr2 and a carriage return if Addr2 is not blank. I have two problems with this at the moment: 1. The carriage return is not working 2. If the text for Addr2 is "Level 21" only 21 is being displayed. I have included the spaces in the IF statement as it appears in my doc. Can someone point out where I have gone wrong? I am using Word 2003 Thanks in advance |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
which statement right , question is Choose the correct statement? | Microsoft Word Help | |||
which statement right , question isChoose the correct statement? | Microsoft Word Help | |||
If statement | Mailmerge | |||
If statement problems in mail merge | Mailmerge | |||
or statement | Mailmerge |