Udostępnij za pośrednictwem


Document.FormFields Property (2007 System)

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

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property FormFields As FormFields
'Usage
Dim instance As Document 
Dim value As FormFields 

value = instance.FormFields
[BrowsableAttribute(false)]
public FormFields FormFields { get; }
[BrowsableAttribute(false)]
public:
property FormFields^ FormFields {
    FormFields^ get ();
}
public function get FormFields () : FormFields

Property Value

Type: FormFields
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.

This example is for a document-level customization.

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

.NET Framework Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace