Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Zip code merging when 5 AND 9 digits
Our academic software has a program that allows us to run letters using a
macro program (WINTEG.WORD) between the software and Word. One of the problems is that the leading "0" is lost during the process. Have visited www.gmayor.com for solutions. Using {MERGEFIELD Zip\# "00000"} doesn't work when there are 9 digits in the zip code. I have tried to use the {IF {MERGEFIELD...} to add trailing zeroes to the 5 digit field suggestion on the site also. Once I update the field though, all I get is MERGEFIELD rather than LrZip and the data doesn't merge. Could this be a syntax issue? My field is as follows { IF { MERGEFIELD LrZip } "9999" "{ MERGEFIELD LrZip\# "00000'-'0000"}""{MERGEFIELD LrZip\# "00000"}-0000" } Any suggestions? |
#2
|
|||
|
|||
The main thing is that all the {} have to be the special field braces that
you can insert using ctrl-F9. The ordinary ones on the keyboard do not work. Peter Jamieson "Spring Velazquez, Widener University" Spring Velazquez, Widener wrote in message ... Our academic software has a program that allows us to run letters using a macro program (WINTEG.WORD) between the software and Word. One of the problems is that the leading "0" is lost during the process. Have visited www.gmayor.com for solutions. Using {MERGEFIELD Zip\# "00000"} doesn't work when there are 9 digits in the zip code. I have tried to use the {IF {MERGEFIELD...} to add trailing zeroes to the 5 digit field suggestion on the site also. Once I update the field though, all I get is MERGEFIELD rather than LrZip and the data doesn't merge. Could this be a syntax issue? My field is as follows { IF { MERGEFIELD LrZip } "9999" "{ MERGEFIELD LrZip\# "00000'-'0000"}""{MERGEFIELD LrZip\# "00000"}-0000" } Any suggestions? |
#4
|
|||
|
|||
Have a look at the relevant section at
http://www.gmayor.com/formatting_word_fields.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Peter - you are a genius! I haven't delved that much into programming in Word so I was not aware of that. Now I'm going to push my luck - some of the zip codes that come in already have the +4 - using the syntax below, it's actually replacing the imported +4 zip with 4 zeroes. How could I arrange this to look at the +4, if it's there leave it, but if it's not add the zeroes. This all started because of the leading zeroes in my zip code being stripped! Spring "Peter Jamieson" wrote: The main thing is that all the {} have to be the special field braces that you can insert using ctrl-F9. The ordinary ones on the keyboard do not work. Peter Jamieson "Spring Velazquez, Widener University" Spring Velazquez, Widener wrote in message ... Our academic software has a program that allows us to run letters using a macro program (WINTEG.WORD) between the software and Word. One of the problems is that the leading "0" is lost during the process. Have visited www.gmayor.com for solutions. Using {MERGEFIELD Zip\# "00000"} doesn't work when there are 9 digits in the zip code. I have tried to use the {IF {MERGEFIELD...} to add trailing zeroes to the 5 digit field suggestion on the site also. Once I update the field though, all I get is MERGEFIELD rather than LrZip and the data doesn't merge. Could this be a syntax issue? My field is as follows { IF { MERGEFIELD LrZip } "9999" "{ MERGEFIELD LrZip\# "00000'-'0000"}""{MERGEFIELD LrZip\# "00000"}-0000" } Any suggestions? |
#5
|
|||
|
|||
Graham - I did follow the instructions on your website. What is happening is
that when a nine-digit zip code is already present - the +4 numbers are replaced with 4 zeroes. Any suggestions? Spring "Graham Mayor" wrote: Have a look at the relevant section at http://www.gmayor.com/formatting_word_fields.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Peter - you are a genius! I haven't delved that much into programming in Word so I was not aware of that. Now I'm going to push my luck - some of the zip codes that come in already have the +4 - using the syntax below, it's actually replacing the imported +4 zip with 4 zeroes. How could I arrange this to look at the +4, if it's there leave it, but if it's not add the zeroes. This all started because of the leading zeroes in my zip code being stripped! Spring "Peter Jamieson" wrote: The main thing is that all the {} have to be the special field braces that you can insert using ctrl-F9. The ordinary ones on the keyboard do not work. Peter Jamieson "Spring Velazquez, Widener University" Spring Velazquez, Widener wrote in message ... Our academic software has a program that allows us to run letters using a macro program (WINTEG.WORD) between the software and Word. One of the problems is that the leading "0" is lost during the process. Have visited www.gmayor.com for solutions. Using {MERGEFIELD Zip\# "00000"} doesn't work when there are 9 digits in the zip code. I have tried to use the {IF {MERGEFIELD...} to add trailing zeroes to the 5 digit field suggestion on the site also. Once I update the field though, all I get is MERGEFIELD rather than LrZip and the data doesn't merge. Could this be a syntax issue? My field is as follows { IF { MERGEFIELD LrZip } "9999" "{ MERGEFIELD LrZip\# "00000'-'0000"}""{MERGEFIELD LrZip\# "00000"}-0000" } Any suggestions? |
#6
|
|||
|
|||
Forget the conditional field for the moment - what happens with your 9 digit
numbers when you insert the following fields? { MERGEFIELD LrZip \# "00000'-'0000"} and { MERGEFIELD LrZip} -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Graham - I did follow the instructions on your website. What is happening is that when a nine-digit zip code is already present - the +4 numbers are replaced with 4 zeroes. Any suggestions? Spring "Graham Mayor" wrote: Have a look at the relevant section at http://www.gmayor.com/formatting_word_fields.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Peter - you are a genius! I haven't delved that much into programming in Word so I was not aware of that. Now I'm going to push my luck - some of the zip codes that come in already have the +4 - using the syntax below, it's actually replacing the imported +4 zip with 4 zeroes. How could I arrange this to look at the +4, if it's there leave it, but if it's not add the zeroes. This all started because of the leading zeroes in my zip code being stripped! Spring "Peter Jamieson" wrote: The main thing is that all the {} have to be the special field braces that you can insert using ctrl-F9. The ordinary ones on the keyboard do not work. Peter Jamieson "Spring Velazquez, Widener University" Spring Velazquez, Widener wrote in message ... Our academic software has a program that allows us to run letters using a macro program (WINTEG.WORD) between the software and Word. One of the problems is that the leading "0" is lost during the process. Have visited www.gmayor.com for solutions. Using {MERGEFIELD Zip\# "00000"} doesn't work when there are 9 digits in the zip code. I have tried to use the {IF {MERGEFIELD...} to add trailing zeroes to the 5 digit field suggestion on the site also. Once I update the field though, all I get is MERGEFIELD rather than LrZip and the data doesn't merge. Could this be a syntax issue? My field is as follows { IF { MERGEFIELD LrZip } "9999" "{ MERGEFIELD LrZip\# "00000'-'0000"}""{MERGEFIELD LrZip\# "00000"}-0000" } Any suggestions? |
#7
|
|||
|
|||
Graham,
When I changed LrZip to {MERGEFIELD LrZip\# "00000'-'0000"} I get the following problems with my zip codes: 00001-9063 - the zip code is led by 4 leading zeroes. When you say and {MERGEFIELD LrZip} should that be a part of the same zip code field? In other words, when I toggle the field LrZip should it say: {MERGEFIELD LrZip\# "00000'-'0000"} and {MERGEFIELD LrZip} as the same field? When I just leave the field as {MERGEFIELD LrZip} I get the +4 digits fine on the zip code, but that is when the leading zeroes are lost. Spring "Graham Mayor" wrote: Forget the conditional field for the moment - what happens with your 9 digit numbers when you insert the following fields? { MERGEFIELD LrZip \# "00000'-'0000"} and { MERGEFIELD LrZip} -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Graham - I did follow the instructions on your website. What is happening is that when a nine-digit zip code is already present - the +4 numbers are replaced with 4 zeroes. Any suggestions? Spring "Graham Mayor" wrote: Have a look at the relevant section at http://www.gmayor.com/formatting_word_fields.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Peter - you are a genius! I haven't delved that much into programming in Word so I was not aware of that. Now I'm going to push my luck - some of the zip codes that come in already have the +4 - using the syntax below, it's actually replacing the imported +4 zip with 4 zeroes. How could I arrange this to look at the +4, if it's there leave it, but if it's not add the zeroes. This all started because of the leading zeroes in my zip code being stripped! Spring "Peter Jamieson" wrote: The main thing is that all the {} have to be the special field braces that you can insert using ctrl-F9. The ordinary ones on the keyboard do not work. Peter Jamieson "Spring Velazquez, Widener University" Spring Velazquez, Widener wrote in message ... Our academic software has a program that allows us to run letters using a macro program (WINTEG.WORD) between the software and Word. One of the problems is that the leading "0" is lost during the process. Have visited www.gmayor.com for solutions. Using {MERGEFIELD Zip\# "00000"} doesn't work when there are 9 digits in the zip code. I have tried to use the {IF {MERGEFIELD...} to add trailing zeroes to the 5 digit field suggestion on the site also. Once I update the field though, all I get is MERGEFIELD rather than LrZip and the data doesn't merge. Could this be a syntax issue? My field is as follows { IF { MERGEFIELD LrZip } "9999" "{ MERGEFIELD LrZip\# "00000'-'0000"}""{MERGEFIELD LrZip\# "00000"}-0000" } Any suggestions? |
#8
|
|||
|
|||
I meant use the field twice - once with and once without the switch to
establish what occurs when the raw data is merged, but I want to know what happens with 9 digit zips as it was these that you were having problems with using the codes from my web site. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Graham, When I changed LrZip to {MERGEFIELD LrZip\# "00000'-'0000"} I get the following problems with my zip codes: 00001-9063 - the zip code is led by 4 leading zeroes. When you say and {MERGEFIELD LrZip} should that be a part of the same zip code field? In other words, when I toggle the field LrZip should it say: {MERGEFIELD LrZip\# "00000'-'0000"} and {MERGEFIELD LrZip} as the same field? When I just leave the field as {MERGEFIELD LrZip} I get the +4 digits fine on the zip code, but that is when the leading zeroes are lost. Spring "Graham Mayor" wrote: Forget the conditional field for the moment - what happens with your 9 digit numbers when you insert the following fields? { MERGEFIELD LrZip \# "00000'-'0000"} and { MERGEFIELD LrZip} -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Graham - I did follow the instructions on your website. What is happening is that when a nine-digit zip code is already present - the +4 numbers are replaced with 4 zeroes. Any suggestions? Spring "Graham Mayor" wrote: Have a look at the relevant section at http://www.gmayor.com/formatting_word_fields.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Peter - you are a genius! I haven't delved that much into programming in Word so I was not aware of that. Now I'm going to push my luck - some of the zip codes that come in already have the +4 - using the syntax below, it's actually replacing the imported +4 zip with 4 zeroes. How could I arrange this to look at the +4, if it's there leave it, but if it's not add the zeroes. This all started because of the leading zeroes in my zip code being stripped! Spring "Peter Jamieson" wrote: The main thing is that all the {} have to be the special field braces that you can insert using ctrl-F9. The ordinary ones on the keyboard do not work. Peter Jamieson "Spring Velazquez, Widener University" Spring Velazquez, Widener wrote in message ... Our academic software has a program that allows us to run letters using a macro program (WINTEG.WORD) between the software and Word. One of the problems is that the leading "0" is lost during the process. Have visited www.gmayor.com for solutions. Using {MERGEFIELD Zip\# "00000"} doesn't work when there are 9 digits in the zip code. I have tried to use the {IF {MERGEFIELD...} to add trailing zeroes to the 5 digit field suggestion on the site also. Once I update the field though, all I get is MERGEFIELD rather than LrZip and the data doesn't merge. Could this be a syntax issue? My field is as follows { IF { MERGEFIELD LrZip } "9999" "{ MERGEFIELD LrZip\# "00000'-'0000"}""{MERGEFIELD LrZip\# "00000"}-0000" } Any suggestions? |
#9
|
|||
|
|||
Okay, when I use the switch, my zip codes are led by zeroes so the zip code
of 19063 becomes 00001-9603. When I don't put the switch in, 19063 is fine, 19063-4514 is fine, but zip code 08632 becomes 8632. "Graham Mayor" wrote: I meant use the field twice - once with and once without the switch to establish what occurs when the raw data is merged, but I want to know what happens with 9 digit zips as it was these that you were having problems with using the codes from my web site. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Graham, When I changed LrZip to {MERGEFIELD LrZip\# "00000'-'0000"} I get the following problems with my zip codes: 00001-9063 - the zip code is led by 4 leading zeroes. When you say and {MERGEFIELD LrZip} should that be a part of the same zip code field? In other words, when I toggle the field LrZip should it say: {MERGEFIELD LrZip\# "00000'-'0000"} and {MERGEFIELD LrZip} as the same field? When I just leave the field as {MERGEFIELD LrZip} I get the +4 digits fine on the zip code, but that is when the leading zeroes are lost. Spring "Graham Mayor" wrote: Forget the conditional field for the moment - what happens with your 9 digit numbers when you insert the following fields? { MERGEFIELD LrZip \# "00000'-'0000"} and { MERGEFIELD LrZip} -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Graham - I did follow the instructions on your website. What is happening is that when a nine-digit zip code is already present - the +4 numbers are replaced with 4 zeroes. Any suggestions? Spring "Graham Mayor" wrote: Have a look at the relevant section at http://www.gmayor.com/formatting_word_fields.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Peter - you are a genius! I haven't delved that much into programming in Word so I was not aware of that. Now I'm going to push my luck - some of the zip codes that come in already have the +4 - using the syntax below, it's actually replacing the imported +4 zip with 4 zeroes. How could I arrange this to look at the +4, if it's there leave it, but if it's not add the zeroes. This all started because of the leading zeroes in my zip code being stripped! Spring "Peter Jamieson" wrote: The main thing is that all the {} have to be the special field braces that you can insert using ctrl-F9. The ordinary ones on the keyboard do not work. Peter Jamieson "Spring Velazquez, Widener University" Spring Velazquez, Widener wrote in message ... Our academic software has a program that allows us to run letters using a macro program (WINTEG.WORD) between the software and Word. One of the problems is that the leading "0" is lost during the process. Have visited www.gmayor.com for solutions. Using {MERGEFIELD Zip\# "00000"} doesn't work when there are 9 digits in the zip code. I have tried to use the {IF {MERGEFIELD...} to add trailing zeroes to the 5 digit field suggestion on the site also. Once I update the field though, all I get is MERGEFIELD rather than LrZip and the data doesn't merge. Could this be a syntax issue? My field is as follows { IF { MERGEFIELD LrZip } "9999" "{ MERGEFIELD LrZip\# "00000'-'0000"}""{MERGEFIELD LrZip\# "00000"}-0000" } Any suggestions? |
#10
|
|||
|
|||
With the following field construction
{IF { MERGEFIELD ZIP } "99999" { MERGEFIELD ZIP \# "00000'-'0000" } { MERGEFIELD ZIP \# "00000" } } 19063 appears as 19063 190634514 appears as 19063-4514 and 8632 appears as 08632 Note, in your original post, you mention using "9999" rather than "99999" -- Please respond to the Newsgroup for the benefit of others who may be interested. Questions sent directly to me will only be answered on a paid consulting basis. Hope this helps, Doug Robbins - Word MVP "Spring Velazquez, Widener University" osoft.com wrote in message ... Okay, when I use the switch, my zip codes are led by zeroes so the zip code of 19063 becomes 00001-9603. When I don't put the switch in, 19063 is fine, 19063-4514 is fine, but zip code 08632 becomes 8632. "Graham Mayor" wrote: I meant use the field twice - once with and once without the switch to establish what occurs when the raw data is merged, but I want to know what happens with 9 digit zips as it was these that you were having problems with using the codes from my web site. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Graham, When I changed LrZip to {MERGEFIELD LrZip\# "00000'-'0000"} I get the following problems with my zip codes: 00001-9063 - the zip code is led by 4 leading zeroes. When you say and {MERGEFIELD LrZip} should that be a part of the same zip code field? In other words, when I toggle the field LrZip should it say: {MERGEFIELD LrZip\# "00000'-'0000"} and {MERGEFIELD LrZip} as the same field? When I just leave the field as {MERGEFIELD LrZip} I get the +4 digits fine on the zip code, but that is when the leading zeroes are lost. Spring "Graham Mayor" wrote: Forget the conditional field for the moment - what happens with your 9 digit numbers when you insert the following fields? { MERGEFIELD LrZip \# "00000'-'0000"} and { MERGEFIELD LrZip} -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Graham - I did follow the instructions on your website. What is happening is that when a nine-digit zip code is already present - the +4 numbers are replaced with 4 zeroes. Any suggestions? Spring "Graham Mayor" wrote: Have a look at the relevant section at http://www.gmayor.com/formatting_word_fields.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Widener University wrote: Peter - you are a genius! I haven't delved that much into programming in Word so I was not aware of that. Now I'm going to push my luck - some of the zip codes that come in already have the +4 - using the syntax below, it's actually replacing the imported +4 zip with 4 zeroes. How could I arrange this to look at the +4, if it's there leave it, but if it's not add the zeroes. This all started because of the leading zeroes in my zip code being stripped! Spring "Peter Jamieson" wrote: The main thing is that all the {} have to be the special field braces that you can insert using ctrl-F9. The ordinary ones on the keyboard do not work. Peter Jamieson "Spring Velazquez, Widener University" Spring Velazquez, Widener wrote in message ... Our academic software has a program that allows us to run letters using a macro program (WINTEG.WORD) between the software and Word. One of the problems is that the leading "0" is lost during the process. Have visited www.gmayor.com for solutions. Using {MERGEFIELD Zip\# "00000"} doesn't work when there are 9 digits in the zip code. I have tried to use the {IF {MERGEFIELD...} to add trailing zeroes to the 5 digit field suggestion on the site also. Once I update the field though, all I get is MERGEFIELD rather than LrZip and the data doesn't merge. Could this be a syntax issue? My field is as follows { IF { MERGEFIELD LrZip } "9999" "{ MERGEFIELD LrZip\# "00000'-'0000"}""{MERGEFIELD LrZip\# "00000"}-0000" } Any suggestions? |
#11
|
|||
|
|||
Doug Robbins wrote:
Note, in your original post, you mention using "9999" rather than "99999" Damn, I hadn't spotted the missing '9' in the original question. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org |
#12
|
|||
|
|||
The "9999" was simply a typo on my part. I apologize for the confusion. The
actual field has "99999" Something interesting to note - when I select Update field - the field is actually removed. It's blank - when I don't update the field and simply toggle the fields, the following is the error message I get when I have the conditional switch in: Error! Unknown op code for conditional. With just the single switch in, I still get the leading zeroes in the zip code. Spring "Graham Mayor" wrote: Doug Robbins wrote: Note, in your original post, you mention using "9999" rather than "99999" Damn, I hadn't spotted the missing '9' in the original question. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org |
#13
|
|||
|
|||
Just another note here - when using the conditional switch to preserve
existing 9-digit zip codes, the zip code 19083-5008 becomes 14075-0000. Strange no? "Graham Mayor" wrote: Doug Robbins wrote: Note, in your original post, you mention using "9999" rather than "99999" Damn, I hadn't spotted the missing '9' in the original question. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org |
#14
|
|||
|
|||
At some point in the process, there's a bit of simple arithmetice being
performed - 19083-5008 = 14075. Do an Edit Replace on the datasource to get rid of the - so that the zip codes are of the form 190835008. You have not mentioned in what software the datasource is located. If necessary, use a catalog or directory type mailmerge in Word to get it into the form of a Word Table so that you can use Edit Replace on it. -- Please respond to the Newsgroup for the benefit of others who may be interested. Questions sent directly to me will only be answered on a paid consulting basis. Hope this helps, Doug Robbins - Word MVP "Spring Velazquez, Widener University" osoft.com wrote in message ... Just another note here - when using the conditional switch to preserve existing 9-digit zip codes, the zip code -0000. Strange no? "Graham Mayor" wrote: Doug Robbins wrote: Note, in your original post, you mention using "9999" rather than "99999" Damn, I hadn't spotted the missing '9' in the original question. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I get the "0" to print in the zip code when mail merging f. | Microsoft Word Help | |||
Errors in Postal bar code | Mailmerge | |||
How do I use the PRINT field code to ... | Microsoft Word Help | |||
Envelope Bar Code | Page Layout | |||
Mail Merge Zip Code will not format correctly | Mailmerge |