DocumentBase.FormFields 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取一个 FormFields 集合,该集合表示文档中的所有窗体字段。
public Microsoft.Office.Interop.Word.FormFields FormFields { get; }
属性值
一个 FormFields 集合,该集合表示文档中的所有窗体字段。
示例
下面的代码示例将一个复选框窗体字段添加到文档中的第一个段落。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。
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