Method Split
Split(WordDocument, int, int)
Extracts a run of sections into a new standalone document carrying only the definitions that run actually references.
public static WordDocument Split(this WordDocument document, int firstSectionIndex, int sectionCount)
Parameters
documentWordDocumentThe document to split. It is not modified.
firstSectionIndexintThe index of the first section to extract.
sectionCountintThe number of sections to extract.
Returns
- WordDocument
The new document.
Exceptions
- ArgumentNullException
documentis null.- ArgumentOutOfRangeException
The section range is outside the document.
- InvalidDocumentException
The document's media cannot be read because its package is already closed.