Sdílet prostřednictvím


DocumentBase.FormFields Property

Definition

Gets a FormFields collection that represents all the form fields in the document.

public:
 property Microsoft::Office::Interop::Word::FormFields ^ FormFields { Microsoft::Office::Interop::Word::FormFields ^ get(); };
public Microsoft.Office.Interop.Word.FormFields FormFields { get; }
member this.FormFields : Microsoft.Office.Interop.Word.FormFields
Public ReadOnly Property FormFields As FormFields

Property Value

A FormFields collection that represents all the form fields in the document.

Examples

The following code example adds a check box form field to the first paragraph in the document. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentFormFields()
{
    this.Paragraphs[1].Range.InsertParagraphAfter();
    this.FormFields.Add(this.Paragraphs[1].Range,
        Microsoft.Office.Interop.Word.WdFieldType.wdFieldFormCheckBox);
}
Private Sub DocumentFormFields()
    Me.Paragraphs(1).Range.InsertParagraphAfter()
    Me.FormFields.Add(Me.Paragraphs(1).Range, Microsoft.Office.Interop.Word. _
        WdFieldType.wdFieldFormCheckBox)
End Sub

Applies to