Condividi tramite


DocumentBase.Paragraphs Property

Gets a Paragraphs collection that represents all the paragraphs in the document.

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

Syntax

'Declaration
Public ReadOnly Property Paragraphs As Paragraphs
public Paragraphs Paragraphs { get; }

Property Value

Type: Microsoft.Office.Interop.Word.Paragraphs
A Paragraphs collection that represents all the paragraphs in the document.

Examples

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

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.";
}

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace