• 2 minutes to read

The Paragraph class represents paragraphs in the RichEditDocumentServer.

The ParagraphCollection contains all document paragraphs. Access a specific paragraph by its index using the SubDocument.Paragraphs property. The Section.Paragraphs property provides access to a collection of paragraphs in a particular document section. You can also retrieve the paragraph related to the given range using the ReadOnlyParagraphCollection.Get method.

Use one of the following methods to insert new paragraph:

Paragraphs can be formatted directly or using document styles. Refer to the Text Formatting topic for more examples on how to format paragraphs.


The RichEditDocumentServer can load/save, print and export to PDF format documents with paragraph borders. The Word Processing Document API does not provide an API to manage paragraph borders.

The code sample below shows how to change paragraph formatting in code:

Document document = server.Document;
document.AppendText("Modified Paragraph\nNormal\nNormal");
DocumentPosition pos = document.Range.Start;
DocumentRange range = document.CreateRange(pos, 0);
ParagraphProperties pp = document.BeginUpdateParagraphs(range);
// Center paragraph
pp.Alignment = ParagraphAlignment.Center;
// Set triple spacing
pp.LineSpacingType = ParagraphLineSpacing.Multiple;
pp.LineSpacingMultiplier = 3;
// Set left indent at 0.5".
// Default unit is 1/300 of an inch (a document unit).
pp.LeftIndent = DevExpress.Office.Utils.Units.InchesToDocumentsF(0.5f);
// Set tab stop at 1.5"
TabInfoCollection tbiColl = pp.BeginUpdateTabs(true);
TabInfo tbi = new DevExpress.XtraRichEdit.API.Native.TabInfo();
tbi.Alignment = TabAlignmentType.Center;
tbi.Position = DevExpress.Office.Utils.Units.InchesToDocumentsF(1.5f);

We recommend to format paragraphs using ParagraphProperties options instead of specifying the formatting properties directly to the Paragraph object. Use the Paragraph object's properties to check the information.