Combining Word-Documents into one Document creates a bug in the automated numbering of table columns

Hello,

Unfortunately, since the last Aspose patch (version 2020.12), we have encountered a bug that means we can no longer use parts of our software correctly.

What we expect / situation BEFORE the Aspose update:
We use Aspose in our software to combine multiple documents into one main document.
The individual documents contain tables whose columns are automatically numbered. Each numbering starts with “1” and ends with a value “X” corresponding to the length of the table. This is also set in the options of each used Word-document.

If these documents are now listed one below the other in the main document, the following result should be achieved:

The title of the document is transferred to the main document and the numbered table is placed below it. The numbering of the table also starts with “1” in the main document.

The problem / the current status:
Since the update of Aspose, the picture is different:

The first document is displayed correctly in the main document. The numbering of the table starts with “1” and ends (in this example) with “4”. The title of document 2 follows, still correct as far as it goes. However, the numbering of the table continues (in this example with the value “5”) and no longer starts with “1” as desired.

This is very problematic for us, as it means that all references to which we refer to are no longer correct.

What has already been done:
We have already tried various settings in Word itself to fix the problem, unfortunately without success. Our tests suggest that it is due to a setting in Aspose, but we do not know exactly which one.

We therefore hope for your help and would appreciate a short feedback with a suggested solution.

Thank you in advance for your help!

With kind regards
DHC BS

@dhcvision Could you please attach your input documents here for testing? We will check the issue and provide you more information.

Hello,

thank you for the quick response.
Here are some Documents for testing:sub- document 1.docx (29.9 KB)
Main document.docx (33.1 KB)

@dhcvision Please try specifying ImportFormatOptions.KeepSourceNumbering option:

Document main = new Document(@"C:\Temp\Main document.docx");
Document sub = new Document(@"C:\Temp\sub- document 1.docx");

ImportFormatOptions opt = new ImportFormatOptions();
opt.KeepSourceNumbering = true;

main.AppendDocument(sub, ImportFormatMode.UseDestinationStyles, opt);
main.AppendDocument(sub, ImportFormatMode.UseDestinationStyles, opt);

main.Save(@"C:\Temp\out.docx");