Free Support Forum - aspose.com

Word Conditional Rules are not evaluated

Hi,

I have a word document with the following conditional rule

{IF { MERGEFIELD Contact_Fax}="" "Fax Number Not Present" }

When I use Aspose to do mail merge on this document, it does not evaluate the conditional rule. MS word evaluates it and displays "Fax number not present" when the value of Contact_fax is empty. Does Aspose support this feature?

I am evaluating Aspose.Words for replacing our MS word server side mail merge.

GK

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Unfortunately, Aspose.Words still does not update IF fields conditions. We are going to support IF evaluation somewhere in this year, unfortunately, I cannot give you any reliable estimate at the moment. There is an issue #37 in our defect database regarding this.

As a workaround, you can move some expressions into your data source (SQL queries) or into mail merge event handlers in Aspose.Words. In addition, you can update fields inside the document manually (ctrl+A and F9) or using macro. See the following link to learn more.

http://support.microsoft.com/kb/832897

Best regards.

Hi Alexey,

Thanks for the response. Do you think this feature would be available somewhere before June 2009? I was reading the threads related to this issue and I can find threads dating back to 2004 with the request for this.

Our decision to purchase this product soley dependends on the availability of this feature. So please let me know.

GK

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Unfortunately, at current stage, I cannot promise you that this feature will be supported before June. You will be notified as soon as the issue is resolved.

Best regards.

Hi Alexey,
Do you have some sample which I can look to do a work around for this? How can I use the events to handle it? How will I know that the event is for an IF field?

GK

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. There is no way to handle IF fields programmatically. As a workaround you can remove conditional from the template and move conditional logic to SQL query or to code.

Best regards.

The issues you have found earlier (filed as 37) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(31)

Hi,
I just downloaded version 7.0 to check the new IF feature. It doesn’t seems to be working for me.
Here is the field from the template and its output from Aspose mailmerge

Input
Email address : {MERGEFIELD “Contact_Email”} {IF { MERGEFIELD Contact_Email }= “” “Contact does not have an email address” “”}

Output of mail merge
Email address : a@b.com Error! Unknown op code for conditional.

Basically while evaluating IF looks like it is not able to parse the merge field

George

Hi George,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I managed to reproduce the problem on my side. We will let you know once the issue is resolved.

The problem occurs because there is no white space before conditional operator in your expression:

Email address : {MERGEFIELD "Contact_Email"} {IF { MERGEFIELD Contact_Email }= "" "Contact does not have an email address" ""}

As a workaround, you can just add this white space.

Best regards.

The issues you have found earlier (filed as 10628) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(23)