Method SplitParagraph
SplitParagraph(WordDocument, DocumentPosition)
Splits a paragraph at a position, as Enter does.
public static DocumentEdit SplitParagraph(this WordDocument document, DocumentPosition at)
Parameters
documentWordDocumentThe document that holds the position.
atDocumentPositionWhere to split.
Returns
- DocumentEdit
The edit; After is the start of the new second paragraph.
Exceptions
- ArgumentNullException
documentis null.- ArgumentException
The position is not in
document, or falls inside a surrogate pair.- ArgumentOutOfRangeException
The position's offset is outside its paragraph's content.
- InvalidOperationException
The position is inside an inline content control or inside content a reader synthesized, or the paragraph is not in a block container.