Table of Contents

Method InsertTextFormField

Namespace
DocWright.Word.Editing
Assembly
DocWright.Word.dll

InsertTextFormField(WordDocument, DocumentPosition, TextFormFieldOptions?)

Inserts a text form field at a position, splitting a text run there, inside a bookmark of its name.

public static DocumentEdit InsertTextFormField(this WordDocument document, DocumentPosition at, TextFormFieldOptions? options = null)

Parameters

document WordDocument

The document that holds the position.

at DocumentPosition

Where to insert.

options TextFormFieldOptions

The name, the default text, the type, the length, the format and the shared options; null for Word's defaults.

Returns

DocumentEdit

The edit; After is just past the field. Find the field with FindFormField(name).

Exceptions

ArgumentNullException

document is null.

ArgumentException

The position is not in the document, or an option is refused (a name already used, not a name Word takes, a text XML cannot carry, a length below 1).

InvalidOperationException

The position is inside content a reader synthesized or a shape's text box.