Document.Paragraphs 属性 (2007 system)

更新:2007 年 11 月

获取一个 Paragraphs 集合,该集合表示文档中的所有段落。

命名空间:  Microsoft.Office.Tools.Word
程序集:  Microsoft.Office.Tools.Word.v9.0(在 Microsoft.Office.Tools.Word.v9.0.dll 中)

语法

声明
<BrowsableAttribute(False)> _
Public ReadOnly Property Paragraphs As Paragraphs
用法
Dim instance As Document
Dim value As Paragraphs

value = instance.Paragraphs
[BrowsableAttribute(false)]
public Paragraphs Paragraphs { get; }

属性值

类型:Microsoft.Office.Interop.Word.Paragraphs

一个 Paragraphs 集合,表示文档中的所有段落。

示例

下面的代码示例向文档中的第一个段落添加文本。

此示例针对的是文档级自定义项。

Private Sub DocumentParagraphs()
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Me.Paragraphs(1).Range.Text = "This is sample paragraph text."
End Sub 
private void DocumentParagraphs()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    this.Paragraphs[1].Range.Text = "This is sample paragraph text.";
}

权限

另请参见

参考

Document 类

Document 成员

Microsoft.Office.Tools.Word 命名空间