Table of Contents

Method UpdateField

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

UpdateField(WordDocument, DocumentPosition, FieldUpdateOptions?)

Updates the one field at a position, as one undoable edit: the innermost field whose extent holds the position (a reference inside a table of contents entry is that reference, not the table). A table of contents is rebuilt; any other field gets its evaluated result, as UpdateFields(WordDocument, DocumentSpan, FieldUpdateOptions?) gives it; nothing else changes.

public static DocumentEdit UpdateField(this WordDocument document, DocumentPosition at, FieldUpdateOptions? options = null)

Parameters

document WordDocument

The document.

at DocumentPosition

A position in the field, or at its start or end.

options FieldUpdateOptions

The evaluation's clock, culture and page references, or null for invariant defaults.

Returns

DocumentEdit

The edit; empty when there is no field there or its result is already right.

Exceptions

ArgumentNullException

document is null.

ArgumentException

The position is not in document.