Table of Contents

Method InsertCaption

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

InsertCaption(WordDocument, DocumentPosition, CaptionOptions?)

Inserts a caption, as one undoable edit: a new paragraph in Word's Caption style above or below the table the position is in (else its paragraph), holding Label , a SEQ Label * ARABIC field and the title. One above keeps with the next paragraph, as Word's does. Every caption of the label is then numbered again, so one inserted before others moves their numbers on (WQ-0112).

public static DocumentEdit InsertCaption(this WordDocument document, DocumentPosition at, CaptionOptions? options = null)

Parameters

document WordDocument

The document.

at DocumentPosition

A position in the paragraph or table to caption.

options CaptionOptions

The label, title, position and format, or null for Word's defaults (Figure, below).

Returns

DocumentEdit

The edit; After is the end of the caption.

Exceptions

ArgumentNullException

document is null.

ArgumentException

The position is not in the document, or the label or title is not valid.

InvalidOperationException

The paragraph is not in a block container (a text box).