Copy/Paste Excel into Word while maintaining ToC

We arein the process of evaluating a platform to be used for the creation of Word Docummenst with the folloing basic capabilities:

  1. Merge several documents (seems to be suported)

  2. Have a Table of Content (ToC) in the “main” document, that will be updated to cover all documents merged entries.

  3. Have the ability to merge data afrom Excel is some way. Think about Copy/Paste manual operation to imitate.

  4. Some data we need to merge exists in Excel format. We need to findthe most efficient way to “merge” (like smart Copy/Paste) while mantining all Excel formating and keeping the Word ToC correct as the Excel may span over sevarl pages.

  5. Convert to PDF.

  6. Maintain consistent Styles, Header, Fooetr, TOC, Page numbers

@StrataVAR

You can achieve your requirements using Aspose.Words and Aspose.Cells.

Please read : Join and Append Documents

Please move the cursor to the desired location in the document and insert table of content using DocumentBuilder.InsertTableOfContents method. To update the fields in the document, you need to call Document.UpdateFields method. Please read following articles:
Working with Fields
Navigation with Cursor

In this case, we suggest you following solution.

  1. Convert your Excel document to PDF using Aspose.Cells.
  2. Import the PDF into Aspose.Words’ Document. Aspose.Words imports the PDF into its DOM.
  3. Insert the imported document (PDF) into your main word document using Aspose.Words. You can use DocumentBuilder.InsertDocument method or Document.AppendDocument method.

Please read : Join and Append Documents.

Please read : Convert a Document to PDF.

Please note that Aspose.Words mimics the behavior of MS Word. Aspose.Words maintains the styles, header, footer, and TOC page numbers as MS Word does.

You can also read the content of Excel document (cells data) using Aspose.Cells and insert them into Word document using Aspose.Words according to your requirement.