Method InsertDropDownFormField
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
documentWordDocumentThe document that holds the position.
atDocumentPositionWhere to insert.
entriesIReadOnlyList<string>The entries, in order: at most 25 (Word's limit), none empty.
optionsDropDownFormFieldOptionsThe 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.