Table of Contents

Method SetDropCap

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

SetDropCap(WordDocument, DocumentPosition, Paragraph, DropCapSettings, DropCapGeometry)

Gives a paragraph a drop cap, or changes the one it has (Word's Drop Cap: Dropped or In margin, with its options). A new cap takes the paragraph's DroppableText(Paragraph) into a paragraph of its own before the rest, keeping its formatting. One undo step.

public static DocumentEdit SetDropCap(this WordDocument document, DocumentPosition at, Paragraph paragraph, DropCapSettings settings, DropCapGeometry geometry)

Parameters

document WordDocument

The document.

at DocumentPosition

Where the caret is.

paragraph Paragraph

The paragraph (or its cap's own paragraph).

settings DropCapSettings

The cap's settings.

geometry DropCapGeometry

Word's numbers for them (DocWright.Layout.DropCapMeasurer.Measure).

Returns

DocumentEdit

The edit; After is the start of the text after the cap.

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

The position or the paragraph is not in the document, a setting is out of range, or the paragraph has no text to drop (it does not start with a letter or digit, after at most four punctuation marks).

InvalidOperationException

The paragraph is not in the body, or is in a table, a header, a footer, a note or a text box.