joemajestee
Programmer
I am trying to get a mailmerge to work. When I step through the records, the document looks fine, however I encounter an error when I execute the merge to a new document. The error that displays is "A field calculation error occured in record #" for each record. Then in the resulting document, on only the first "property", "Error! Unknown opcode for conditional" shows up instead of the data. When I go back to the original doc, that text then displays in the same place as I step through the records again.
The data source is an excel worksheet. The if statements, the first of which seems to be causing the error are meant to display property information only if the corresponding cell in Excel is not blank. I deleted the first statement and got similar errors eventually. Pasted below is the word code. CRLF is a carriage return.
{ MERGEFIELD "OrgPerson_SortName" } - Total of Units is {MERGEFIELD "Total_Units"}
Property List with Unit Count:{ IF{ MERGEFIELD "Prop1" }"CRLF{ MERGEFIELD "Prop1"}, { MERGEFIELD "Unit1" } Units"}{ IF{ MERGEFIELD "Prop2" }"CRLF{ MERGEFIELD "Prop2"}, { MERGEFIELD "Unit2" } Units"}{ IF{ MERGEFIELD "Prop3" }"CRLF{ MERGEFIELD "Prop3"}, { MERGEFIELD "Unit3" } Units"}
and so on. The error appears immediately after Property List with Unit Count:
Thanks for your help.
The data source is an excel worksheet. The if statements, the first of which seems to be causing the error are meant to display property information only if the corresponding cell in Excel is not blank. I deleted the first statement and got similar errors eventually. Pasted below is the word code. CRLF is a carriage return.
{ MERGEFIELD "OrgPerson_SortName" } - Total of Units is {MERGEFIELD "Total_Units"}
Property List with Unit Count:{ IF{ MERGEFIELD "Prop1" }"CRLF{ MERGEFIELD "Prop1"}, { MERGEFIELD "Unit1" } Units"}{ IF{ MERGEFIELD "Prop2" }"CRLF{ MERGEFIELD "Prop2"}, { MERGEFIELD "Unit2" } Units"}{ IF{ MERGEFIELD "Prop3" }"CRLF{ MERGEFIELD "Prop3"}, { MERGEFIELD "Unit3" } Units"}
and so on. The error appears immediately after Property List with Unit Count:
Thanks for your help.