Heading numbers don't accurately update

When inserting multiple documents into a document, the heading numbers don’t always update correctly.
image.png (393.6 KB)

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

Hi there. I am working on getting a public version of the documents. In the mean time, is there some documentation on those headings, or, when documentBuilder inserts the document, are they just slapped in there?
By the way, it was 5 documents. The first document was the shell, and had a table of contents. The second document had section headings 1 - 4. The 3rd document had no section heading. The 4th document had a section heading 1. The 5th document had a section heading of 1.

@derek444 If the numbering is defined in Heading style, you can try using ImportFormatMode.UseDestinationStyles when you merge documents. In this case heading style from the main document is used and numbering should be applied properly.
Also, there is ImportFormatOptions.KeepSourceNumbering that controls how numbering is handled upon merging documents together. By default this option is disabled.
But it would be better if you share the problematic documents and code you are using for merging them. This will help us to understand what the problem is and help you.