Skip to main content
.NET Framework 4.5.2+

Paragraph Class

A document paragraph.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v22.1.Core.dll


public abstract class Paragraph


Access Paragraphs

The ParagraphCollection contains all document paragraphs. Use the SubDocument.Paragraphs property to access a specific paragraph by its index. The Section.Paragraphs property obtains a collection of paragraphs in a specific document section. Call the ReadOnlyParagraphCollection.Get method to retrieve a paragraph related to a specific range.

Format Paragraphs

Yoy can format paragraphs directly or use document styles. Refer to the following topic for more examples on how to format paragraphs:

Read Tutorial: Text Formatting


The code sample below appends a paragraph and inserts a paragraph at the start of the second section:

using DevExpress.XtraRichEdit.API.Native;

using (var wordProcessor = new RichEditDocumentServer())
  Document document = wordProcessor.Document;

  // Start the document update:

  // Append a paragraph:
  Paragraph appendedParagraph = document.Paragraphs.Append();
  document.InsertText(appendedParagraph.Range.Start, "Appended paragraph");

  // Insert a paragraph at the start of the second section:
  Paragraph paragraph =
  DocumentPosition position =
     document.Paragraphs[paragraph.Index - 1].Range.Start;
  document.InsertText(position, "Inserted paragraph");

  // Finalize the document update:

The following code snippets (auto-collected from DevExpress Examples) contain references to the Paragraph class.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.


See Also