Table of Contents

Method InsertDropDownFormField

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

InsertDropDownFormField(WordDocument, DocumentPosition, IReadOnlyList<string>, DropDownFormFieldOptions?)

Inserts a drop-down form field with its entries at a position, inside a bookmark of its name.

public static DocumentEdit InsertDropDownFormField(this WordDocument document, DocumentPosition at, IReadOnlyList<string> entries, DropDownFormFieldOptions? options = null)

Parameters

document WordDocument

The document that holds the position.

at DocumentPosition

Where to insert.

entries IReadOnlyList<string>

The entries, in order: at most 25 (Word's limit), none empty.

options DropDownFormFieldOptions

The name, the default entry and the shared options; null for Word's defaults.

Returns

DocumentEdit

The edit; After is just past the field.

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

The position is not in the document, more than 25 entries, an empty entry, a default index outside the entries, or an option refused.