This line of code…
public static void CombineDocuments(Aspose.Words.Document parentDoc, Aspose.Words.Document subDoc, bool startOnNewPage)
{
int count = 0;
foreach(Section srcSection in subDoc)
{
Section dstSection = null;
dstSection = (Section) parentDoc.ImportNode(srcSection, true, ImportFormatMode.KeepSourceFormatting);
Get’s the following error with the attached doc if it uses an autonumber. If it doesn’t everything works fine.
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at Aspose.Words.Lists.ListLevelCollection.get_Item(Int32 index)
at Aspose.Words.Lists.ListCollection. ? ( ? ? , Int32 ? , Boolean ? )
at Aspose.Words.StyleCollection.?(? ?, Style ?, Style ?)
at Aspose.Words.StyleCollection.?(? ?, Style ?)
at Aspose.Words.Lists.ListCollection.?(? ?, Int32 ?, Boolean ?)
at Aspose.Words.NodeImporter.ImportNode(Node srcNode, Boolean isImportChildren)
at Aspose.Words.NodeImporter.?(CompositeNode ?, CompositeNode ?, Boolean ?)
at Aspose.Words.NodeImporter.ImportNode(Node srcNode, Boolean isImportChildren)
at Aspose.Words.NodeImporter.?(CompositeNode ?, CompositeNode ?, Boolean ?)
at Aspose.Words.NodeImporter.ImportNode(Node srcNode, Boolean isImportChildren)
at Aspose.Words.DocumentBase.ImportNode(Node srcNode, Boolean isImportChildren, ImportFormatMode importFormatMode)
at Systrends.TMS.Business.DocumentGeneration.CombineDocuments(Document parentDoc, Document subDoc, Boolean startOnNewPage) in C:\Documents and Settings\Davids\My Documents\Visual Studio 2008\Projects\tms\trunk\business\DocumentGeneration.cs:line 1291
I have attached copies of the documents that work and that do not work. I tested this with 8.2.1, 8.2.2, and 9.0 and all the get same error.