Problem when updating fields

I have a Word document where I’m cloning some nodes (Words::Node) and inserting them into the document with Aspose.Words 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.


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");

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:
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.


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 to but in the problem has been solved. Thanks and regards.


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:
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 Thanks and regards.


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,