Table of Contents

Method RemoveFormField

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

RemoveFormField(WordDocument, FormField)

Removes a form field: its field characters, code and result, and the bookmark of its name around it (where Flatten() keeps the result as text).

public static DocumentEdit RemoveFormField(this WordDocument document, FormField field)

Parameters

document WordDocument

The document that holds the field.

field FormField

The field, as found.

Returns

DocumentEdit

The edit; After is where the field was.

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

The field is not in document.

InvalidOperationException

The field spans paragraphs, or the document changed since it was found.