Free Support Forum - aspose.com

Aspose.Word Questions

Hello,

I am evaluatingAspose.Word for use in our document production and have the following questions:

1. Does the MailMerge.Execute Method support the IF…THEN…ELSE type merge field in Word? What about Nesting?

2. Does the MailMerge.Execute Method support the SKIP RECORD IF type merge field in Word?

3. Does the MailMerge.Execute Method support the FILL-IN type merge field in Word?

4. I had read in the forums that you were working on Printing Support for this product. What is the latest news? Will a Beta version be available in the near future?

5. I had read in the forums that you were working on Preview Support for this product. What is the latest news? Will a Beta version be available in the near future?

6. Is there a maximum MergeField Length i.e. { MERGEFIELD ThisIsMyVeryVeryVeryLongMergeField }

Thank you for your assistance.

Hi,

Thank you for your interest in Aspose.Word.

1. Aspose.Word supports nested fields in general, but does not evaluate expressions in IF fields and the like. You can use mail merge events to hook into the mail merge process and take this decisions inside your code as opposed to inside a document.

2. To skip record when a certain criteria is met or not met it is easiest and most convenient to filter your DataTable or DataView before executing mail merge. This is why Aspose.Word does not evaluate or deal with NEXTIF fields. However, NEXT field is supported at it allows to build to build some types of documents such as mail labels.

3. FILLIN field is not processed by Aspose.Word because the purpose of the fill in field is to ask the user for input. Aspose.Word is a non visual component and does not expose any user interface such as prompts for user input. Again, you can do all of this easier in your code, for example in response to mail merge events.

4 and 5. Printing and Previwing of documents will be available at about the same time. It is however a little early to tell when exactly. Estimate is still 2-3 months. There are plans to implement full editing control after that.

6. There is no limit imposed on the merge field length by Aspose.Word as it uses just .NET strings. However, there might be some limit imposed by different versions of MS Word.





Thanks for the reply so soon.

You suggest that:

"You can use mail merge events to hook into the mail merge process and take this decisions inside your code as opposed to inside a document"

I can only find the 'MergeField' Event which would only appear to fire when it hits a { MERGEFIELD ... } field.

What Events / Collection would expose an {IF ...} type field?

Thanks
Stephen

You are right, events are raised only for merge fields. The idea I’m proposing is not to have any IF fields in the document. Once you get your event handler called you can determine what field it is being called for and execute any conditional of business logic you want.

I understand this solution is not suitable for all situations and since several clients already requested support for IF fields we will seriously consider implementing it in the future.


This is something we’d definitely like to see as we have just hit a problem where we have conditional logic in a field and the user has to manually update that field before it shows the correct value (although this is not a problem if the field is in the header or footer as fields there get updated automatically when the document is opened).

Cheers,
Phil

We also have a desparate need to support IF fields.

Our clients’ templates are changed frequently by the users so they need
control of the IF logic. They basically use it to change wording
or hide sections of the document based on boolean fields in the data
source.

Since our users use MS word to develop their templates they are very
disillusioned when the results are different in our application.

We’ve just discovered the work around is to do Ctrl A, F9 after every
merge however the merge results are deceptively wrong if this is
overlooked.

This makes both our application and Aspose look kludgy which is undeserved.



So I’m hoping this is on the short list not just the wish llist

I am afraid that the IF field support is not on the top of our priority list right now. If you need help with workarounds for some of your specific problems please don’t hesitate to post requests here.