Represents a paragraph in the Word document. Technically, a paragraph is a block of text that ends with a carriage return.

 public class Paragraph : Element
Public Class Paragraph
		Inherits Element

To create a new paragraph, use Element.InsertParagraphBefore() or Element.InsertParagraphAfter(). Each of these methods take a single argument of type NamedStyle. This argument can be null. If it is null, the Normal style is used. This method can be called from the Document object because Document inherits from the Element class.


          //--- Insert a paragraph at the end of a new document and add some sample text
          WordApplication app = new WordApplication();
          Document doc = app.Create();
          Paragraph paragraph = doc.InsertParagraphAfter(null);
          paragraph.InsertTextAfter("This is a new paragraph.");

          //--- Get the first paragraph of an existing document
          WordApplication app = new WordApplication();
          Document doc = app.Open(@"C:\sample.doc");
          Paragraph firstParagraph = doc.Elements(Element.Type.Paragraph)[0];
        

          '--- Insert a paragraph at the end of a new document and add some sample text
          Dim app As New WordApplication()
          Dim doc As Document = app.Create()
          Dim parargraph As Paragraph = doc.InsertParagraphAfter(Nothing)
          paragraph.InsertTextAfter("This is a new paragraph.")

          '--- Get the first paragraph of an existing document
          Dim app As New WordApplication()
          Dim doc As Document = app.Open("C:\sample.doc")
          Dim blocks() As BlockElements = doc.BlockElements
          Dim firstParagraph As Paragraph = doc.Elements(Element.Type.Paragraph)(0)
        

Name

Description

Formatting

Style