View Single Post
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
John John is offline
external usenet poster
 
Posts: 307
Default Zip Code formatting Problem Word 2007

I have Excel spreadsheet with cells/column that contain either 5 or 9 zip
code numbers. I want the zip code numbers to print in my merged Word
document as what they are, either 5 or 9 digits and blank if nothing. But I
keep getting error code as noted below when inputting the correct merge code
in the Word document.

I am using XP Pro, Microsoft Small Business Exchange Server with Office 2007
Ultimate version.

Excel 2007 xls spreadsheet as DB. Column formatted as numbers with both 5
and 9 digits in cells. Numbers are entered as continuous number of 5 or 9
digits.

Word merge is formatted as per Graham Mayor article "Formatting Word
Fields." I have checked and re-checked my typing and it is exactly as Mr.
Mayor indicates in his article. I have read every other post on this
discussion group regarding zip code formatting and tried all options offered.
None work for me. I am using the CTRL+F9 for the IF statement and using the
insert merge field choice on the Word ribbon.

My problem is that when I set up my mailmerge formatting in Word document
for the zip code field I get the following error message.

Error! Unknown op code for conditional.

This is the code that I am typing:
{IF{MERGEFIELD Employer Zip} 99999"{MERGEFIELD Employer
Zip\#"00000'-'0000"}""{MERGEFIELD Employer Zip\#"00000"}"}

as noted in Mr. Mayor's examples I have tried:
removing the '-'.
adding the ;;
different spacing around the merge code and \
replacing the 99999 with 00000

Nothing is working. What am I doing wrong?

Any help would be greatly appreciated.
--
John R.