I have a strange issue to report. The list feature “Continue Numbering” is failing whenever Document.MailMerge.Execute is called after appending documents that contain numbered lists.
I’m using Aspose.Words v18.11.0.
Here are the steps to reproduce:
Create and save 2 new Word documents (I have samples, but I don’t see where to attach them to this topic). Both documents should contain a simple numbered list like this:
Numbered List Part 1.docx
1. First Line 2. Second Line 3. Third Line
Numbered List Part 2.docx
1. Fourth Line 2. Fifth Line 3. Sixth Line
Code to Reproduce
Document doc = new Document("Numbered List Part 1.docx"); Document doc2 = new Document("Numbered List Part 2.docx"); doc2.FirstSection.PageSetup.SectionStart = SectionStart.Continuous; doc.AppendDocument(doc2, ImportFormatMode.UseDestinationStyles); List<string> fieldNames = new List<string>(); List<object> fieldValues = new List<object>(); doc.MailMerge.Execute(fieldNames.ToArray(), fieldValues.ToArray()); doc.Save("C:\\test.docx", Aspose.Words.SaveFormat.Docx);
1. First Line 2. Second Line 3. Third Line 4. Fourth Line 5. Fifth Line 6. Sixth Line
1. First Line 2. Second Line 3. Third Line 1. Fourth Line 2. Fifth Line 3. Sixth Line
Here’s the Really Strange Part
If you remove the call to Document.MailMerge.Execute (line #8), the output is generated as expected.
The data source lists are empty in this example, but the same behavior exhibits when the lists are populated.
Also, the same behavior exhibits when calling Document.ExecuteWithRegions.