Table of Contents

Method InsertLine

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

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

document WordDocument

The document that holds the position.

at DocumentPosition

Where the line is anchored: its paragraph, and its place in the paragraph's text.

kind ShapeLineKind

The kind: Word's Line, Line Arrow, Line Arrow: Double, and the elbow and curved connectors.

width Emu

The width of the box from one end to the other (zero for a vertical line).

height Emu

The height of the box (zero for a horizontal line).

flipHorizontal bool

True when the line ends to the left of where it starts.

flipVertical bool

True when the line ends above where it starts.

anchor ImageAnchor

The 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

document is null.

ArgumentException

The position is not in document or 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.