Hi I downloaded Aspose.Words and tried out the free trial version.
I created a word document checking for Gender as IF{MERGEFIELD Gender}="Male" "Mr" "Mrs/Ms"
I passed the parameter through the program.
But it gives the error Error! Unknown op
code for conditional.
Thanks for your inquiry. Could you please attach your document here for testing? I will check the problem on my side and provide you more information.
Best regards,
Thank you for additional information. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed. The problem occurs because there should be white spaces before and after comparison operator { IF { MERGEFIELD Gender } = "Male" "Mr" "Mrs" }
Best regards,
I am also evaluating the trial of your product. I am seeing the same problem as the original poster, however, my expression does have white space before and after the comparison operator. My example essentially looks like the one above, except I am outputting symbols instead of Mr./Mrs.
I have attached the word doc and sample data file. This works just fine in word but I see “unknown op code for conditional” when I run the mail merge through Aspose.
Hi,
The problem might occur if the merge field’s value is an empty string. It has been fixed in the current codebase, so you won’t experience it anymore starting with Aspose.Words 7.1 that is going to be released in a few weeks.
Thanks.
Thank you for additional information. I managed to reproduce the problem on my side. You will be notified as soon as it is resolved.
As a workaround, you can try using line break (Shift+Enter) instead of Paragraph break.
Best regards.
The resolution of 10628 does not seem to fix the issue I thought this post related to. In the example, there should have been a paragraph break between f2 and f3. This does not appear to work after 8.0.0.0 has been installed. The work-around (to use shift-return and create a soft break) does in both 7 and 8.
Thanks for your request. The Issue that you mean is still unresolved. You will be notified as soon as it is fixed. The issue 10628 related to conditional expressions without white space.
Best regards,
Hi
Thank you for additional information. I managed to reproduce the problem with empty values of mergefields. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed.
Best regards.
Good day Andrew, we’ ve got almost same problem with double qoutes. When merging field like this: if "{Mergefield М1}" <> "1" "Text1" "Text2"
In case, when М1 is empty we’ ve got next result: if """" <> "1" "Text1" "Text2"
And we see in the merged document: <>
instead of Text1 or Text2.
It seems that you put double qoutes in empty mergefields.
Thanks in advance.
Thanks for your request. This problem is already resolved in the current codebase. The fix will be included into the next hotfix, which will be released in few weeks.
Best regards,