Method InsertLine
InsertLine(WordDocument, DocumentPosition, ShapeLineKind, Emu, Emu, bool, bool, ImageAnchor?)
Inserts a line or a connector as Word's Insert > Shapes > Lines draws one (Phase 178, WQ-0159): floating in front of text, in Word's line style (the theme's first accent, no fill), with the arrowheads its kind has.
public static DocumentEdit InsertLine(this WordDocument document, DocumentPosition at, ShapeLineKind kind, Emu width, Emu height, bool flipHorizontal, bool flipVertical, ImageAnchor? anchor = null)
Parameters
documentWordDocumentThe document that holds the position.
atDocumentPositionWhere the line is anchored: its paragraph, and its place in the paragraph's text.
kindShapeLineKindThe kind: Word's Line, Line Arrow, Line Arrow: Double, and the elbow and curved connectors.
widthEmuThe width of the box from one end to the other (zero for a vertical line).
heightEmuThe height of the box (zero for a horizontal line).
flipHorizontalboolTrue when the line ends to the left of where it starts.
flipVerticalboolTrue when the line ends above where it starts.
anchorImageAnchorThe box's position and wrap, or null for NewFloatingAnchor().
Returns
- DocumentEdit
The edit; After is just past the line, which is the inline at Before.
Exceptions
- ArgumentNullException
documentis null.- ArgumentException
The position is not in
documentor falls inside a surrogate pair; the kind is not defined; an anchor token is not one the format has.- ArgumentOutOfRangeException
A side is negative or above MaxImageSide, or both are zero.
- InvalidOperationException
The position is inside content a reader synthesized or a shape's text box.