We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose Word 9.1.0 issues

Hi,

I'm testing Aspose.Words 9.1.0 and have some problems with MailMerge and fields evaluation.

code :
Document doc_out = new Document(@"PATH/Template.doc");
DataSet ds = new DataSet();
ds.ReadXml(@"PATH\dataset.xml");
doc_out.MailMerge.Execute(ds.Tables[0]);
doc_out.UpdateFields();
doc_out.MailMerge.DeleteFields();

1- MailMerge.Execute() and TableStart/End in template

This is an ascendant compatibility issue. Some customers have created templates using TableStart/End. It don't works with Aspose.Words 9.1.0 (I'm using MailMerge.execute() method). Is there a property to allow Mergefields in TableStart/tableEnd using execute() method (I don't want to use ExecuteWithRegion() in this case, to repeat all my template for each Datarow)? I attached template and dataset to reproduce the problem (Zip/ExecuteInRegion).

2- IndexOutOfRangeException on MailMerge.execute()

I attached template and dataset to reproduce the problem (Zip/IndexOutOfRange).

3- Error! Unknown op code for conditional

I attached template and dataset to reproduce the problem (Zip/UnknownOpCode).

4- Nested IF without quote, and value starting with paragraph break

I attached template and dataset to reproduce the problem (Zip/NestedIfParagraphBreak).
ex : { IF "A"="A" "text 1" { IF "B"="C" "text 2" "text3" }}. It works fine, but if text 3 is starting with paragraph break, text is not visible.

5- Mergefield not deleted when no data found

When I use MailMerge.execute, Mergefields are replaced by there value. If the datarow don't contains this data, Mergefield is not replace by an empty string. Is there a property to do that without using DeleteFields() after MailMerge.execute() ?

Thanks

Hi

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

Thanks for your request.

1. There is no way to use simple mail merge in case of using TableStart/TableEnd construction. You should redesign your template to avoid using TableStart/TableEnd merge fields where they are not necessary.

2. 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 resolved. For some reason the problem occurs because the name of merge field is the same as the value of this field. So as a workaround please try changing the value (modify dataset.xml) or the merge field name inside the document.

3. In case of using TableStart:MyRegion and TableEnd:MyRegion you should use ExecuteWithRegions method. Please try using the following code:

Document doc = new Document("Template.doc");

DataSet ds = new DataSet();

ds.ReadXml("dataset.xml");

doc.MailMerge.ExecuteWithRegions(ds);

doc.Save("out.doc");

4. As I can see MS Word produces the same result as Aspose.Words does. So there is no problem here.

5. There is no such property. You should use DeleteFields() method.

Best regards,

Hi,

Thanks for your quick reply.

1- ok

2- ok

3- I did this test with ExecuteWithRegions() Method, sorry I forget to specify this.

4- When I update fields with MSWord, it works fine (I attached the produced document and a copy updated with MSWord.

5- ok

Hi

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

Thank you for additional information.

4. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. Please expect a reply before next hotfix (within 4-5 weeks). We might just fix the problem or provide you more information.

Best regards,

ok, thank you

Do you reproduce the issue #3 - Error! Unknown op code for conditional ?

Thanks for your help

Yes, I managed to reproduce the problem #3. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed. As a workaround you can try removing “desnom1” bookmark.

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

Best regards,

ok, I will try this workaround

Thanks for your help and quick replies !

Hi,

I'm trying to find a workaround on issue#4

Have you any idea to resolve this issue ?

Maybe by adding quote around nested IF fields ? Or by adding some text if Then/else clause starts with a paragraph break, and remove this text after evaluation ?

Thanks

Hi

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

Thanks for your request. Currently I cannot suggest you any way to work this problem around. You should just wait for the fix of the original issue. This issue has a high priority, so please expect a reply before next hotfix (within 4-5 weeks).

Best regards,

The issues you have found earlier (filed as 16052;18313;18308) have been fixed in this update.


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