All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.

Paragraph

Insert a paragraph at the cursor position

Related members: insertParagraph(position), activeSubDocument, active

var subDocument = richEdit.selection.activeSubDocument;
var position = richEdit.selection.active;
var paragraph = subDocument.insertParagraph(position);

Apply properties to a paragraph

Related members: Paragraph properties, find(position), alignment, beginUpdate, beginTransaction, activeSubDocument, active, insertText(position, text)

var subDocument = richEdit.selection.activeSubDocument;
var position = richEdit.selection.active;

rich.history.beginTransaction();
rich.beginUpdate();  
var textInterval = subDocument.insertText(position, "Centered text");
subDocument.paragraphs.find(textInterval).forEach(function (paragraph) {
    paragraph.properties = { 
        alignment: DevExpress.RichEdit.ParagraphAlignment.Center,
    }; 
});
rich.endUpdate();  
rich.history.endTransaction();