Table of Contents

Method ExtractFragment

Namespace
DocWright.Dom.Editing
Assembly
DocWright.Dom.dll

ExtractFragment(WordDocument, DocumentSpan)

Copies the content of a span into a fragment.

public static DocumentFragment ExtractFragment(this WordDocument document, DocumentSpan span)

Parameters

document WordDocument

The document that holds the span. It is not modified.

span DocumentSpan

The 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

document is 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.