Method ExtractFragment
ExtractFragment(WordDocument, DocumentSpan)
Copies the content of a span into a fragment.
public static DocumentFragment ExtractFragment(this WordDocument document, DocumentSpan span)
Parameters
documentWordDocumentThe document that holds the span. It is not modified.
spanDocumentSpanThe span. Its ends are in one story; a span ending at a paragraph's start ends with the previous paragraph's mark.
Returns
- DocumentFragment
The fragment; dispose it when done.
Exceptions
- ArgumentNullException
documentis null.- ArgumentException
The span is not in
document, or its ends are in different stories.- InvalidOperationException
An end is in a shape's text box.