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

Free Support Forum - aspose.com

Problem when updating fields

Hi,
I have a Word document where I’m cloning some nodes (Words::Node) and inserting them into the document with Aspose.Words 9.0.0.0. These nodes have the format template “Überschrift 1” or “Überschrift 2”. At the beginning of the document there is a TOC. Before saving I’m updating the fields of the document. Now I got some problems when the TOC is like "TOC \o “2-3” \n \h \z \t “Überschrift 1~1"” as you can see in the attached test_1.doc. The enumeration is not correct.
Everthing works fine when the TOC is like “TOC \o “1-2” \n \h \z” as you can see in the attached test_2.doc.
Thanks and regards.

Hi

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

Thanks for your request. I cannot reproduce the problem on my side using the latest version of Aspose.Words (9.3.0). I use the following code for testing:

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

doc.UpdateFields();

doc.UpdatePageLayout();

doc.Save("out.doc");

The TOC looks correct (like after updating using MS Word).

Could you please try using the latest version of Aspose.Words and let me know how it goes on your side? You can download the latest version from here:

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

Best regards,

Hi, to reproduce the problem you have to open the document and clone e.g. "9 O9" ([...] node->Clone(true)). Then you have to insert that node before another node using the AppendBefore method. Then you have to update the fields and save the document. Meantime I'll download the latest version and test again. Thanks and regards.

Hi

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

Thanks for your inquiry. Could you please attach the code which you use to reproduce the problem? I will investigate the issue and provide you more information.

Best regards,

Hi, it took some time to migrate my code from 9.0.0.0 to 9.3.0.0 but in 9.3.0.0 the problem has been solved. Thanks and regards.

Hi

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

There were a few breaking changes to the API in version 9.2/9.3 You can find full details of these changes in the migration article:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-migrate-to-aspose-words-9-2-or-higher.html

Best regards,

Hi, I have another document (attached sample2.doc) with a TOC that is upated as recommended. The problem is that the first caption "1 Zweck" is no longer a caption after updating the TOC using Aspose.Words 9.3.0.0. Thanks and regards.

Hello

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

Thank you for reporting this problem to us. I managed to reproduce it on my side and linked your request to the appropriate issue. You will be notified as soon as it is resolved.

I have modified your document little bit and now the output looks as expected. Please see the attached document.

Best regards,