Message-ID: <621019922.2541.1710843884023.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2540_1711302999.1710843884023" ------=_Part_2540_1711302999.1710843884023 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Paragraph

Paragraph

Description

=20

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

=20
C#
=20
 public class Paragraph : Element
=20
=20
vb.net
=20
Public Class Paragraph
=09=09Inherits Element
=20
=20

Remarks

To create a new paragraph, use=20 Ele= ment.InsertParagraphBefore() or=20 Elem= ent.InsertParagraphAfter(). Each of these methods take a single argumen= t of type=20 NamedStyle. This a= rgument can be null. If it is null, the Normal style is used. This method c= an be called from the=20 Document object beca= use=20 Document inherits from the=20 Element class.=20

Examples

=20
C#
=20

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

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

          '--- Insert a paragraph at the end of a new document and add some=
 sample text
          Dim app As New WordApplication()
          Dim doc As Document =3D app.Create()
          Dim parargraph As Paragraph =3D 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 =3D app.Open("C:\sample.doc")
          Dim blocks() As BlockElements =3D doc.BlockElements
          Dim firstParagraph As Paragraph =3D doc.Elements(Element.Type.Par=
agraph)(0)
        
=20
=20

Properties

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

Formatting

Sets or returns a ParagraphFormatting object that represents the formattin= g for this paragraph (positioning, line spacing, etc).

Styl= e

Returns or sets an NamedStyle object that represents the Style of this paragraph.=20
------=_Part_2540_1711302999.1710843884023--