Method InsertCaption
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
documentWordDocumentThe document.
atDocumentPositionA position in the paragraph or table to caption.
optionsCaptionOptionsThe 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
documentis 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).