.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

ParagraphStyle Interface

Exposes methods and characteristics of a paragraph style in a document.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v19.2.Core.dll

Declaration

[ComVisible(true)]
public interface ParagraphStyle :
    ParagraphPropertiesWithTabs,
    ParagraphPropertiesBase,
    CharacterPropertiesBase
<ComVisible(True)>
Public Interface ParagraphStyle
    Inherits ParagraphPropertiesWithTabs,
             ParagraphPropertiesBase,
             CharacterPropertiesBase
[ComVisible(true)]
public interface ParagraphStyle :
    ParagraphPropertiesWithTabs,
    ParagraphPropertiesBase,
    CharacterPropertiesBase
<ComVisible(True)>
Public Interface ParagraphStyle
    Inherits ParagraphPropertiesWithTabs,
             ParagraphPropertiesBase,
             CharacterPropertiesBase
[ComVisible(true)]
public interface ParagraphStyle :
    ParagraphPropertiesWithTabs,
    ParagraphPropertiesBase,
    CharacterPropertiesBase
<ComVisible(True)>
Public Interface ParagraphStyle
    Inherits ParagraphPropertiesWithTabs,
             ParagraphPropertiesBase,
             CharacterPropertiesBase

Remarks

A style pertains to a document. It belongs to a particular document model and you cannot just add the style object from a style collection of one document to the style collection of another document.

Document document = server.Document;
document.LoadDocument("Documents\\Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.OpenXml);
ParagraphStyle pstyle = document.ParagraphStyles["MyPStyle"];
if (pstyle == null)
{
    pstyle = document.ParagraphStyles.CreateNew();
    pstyle.Name = "MyPStyle";
    pstyle.LineSpacingType = ParagraphLineSpacing.Double;
    pstyle.Alignment = ParagraphAlignment.Center;
    document.ParagraphStyles.Add(pstyle);
}
document.Paragraphs[2].Style = pstyle;
See Also