The pasted content is not formatted properly, resulting in an InvalidOperationException("'Token EndElement in state EndRootElement would result in an invalid XML document. Make sure that the ConformanceLevel setting is set to ConformanceLevel.Fragment or ConformanceLevel.Auto if you want to write an XML fragment. ') when saving the content to DOCX.
Steps to reproduce:
- Create a document
- Activate Review/Change Tracking
- Create a table in a separate MS Word file and add some text at least in the first cell
- Copy from MS Word and paste it as the first element in the document
- Save the document as an MS Word document
Workaround: intercept the table paste and add an empty paragraph as the first element of the document before the table.
Another case:
- Create a new document
- Be sure that Change Tracking is deactivated
- Create a table in a separate MS Word file and add some text at least in the first cell
- Copy from MS Word and paste it as the first element in the document
- Activate Review/Change Tracking
- Just after the first table, paste the table again: the second table seems to be merged with the first table, with no paragraph in between, but with the vertical line in the margin showing that the second table has change tracking
- Save the document as a MS Word document