Back to Devexpress

ParagraphPropertiesBase.SuppressLineNumbers Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-paragraphpropertiesbase-4792b2c0.md

latest4.1 KB
Original Source

ParagraphPropertiesBase.SuppressLineNumbers Property

Gets or sets whether to display line numbers for the paragraphs.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
bool? SuppressLineNumbers { get; set; }
vb
Property SuppressLineNumbers As Boolean?

Property Value

TypeDescription
Nullable<Boolean>

true if line numbering is suppressed for all paragraphs; false if line numbers are displayed for all paragraphs in a range; or otherwise, null for a mixture of states.

|

Remarks

To enable line numbering, set the SectionLineNumbering.CountBy for the section encompassing the paragraph to a positive integer greater than zero.

Example

View Example: Word Processing Document API – How to Process Word Documents in Code

csharp
using DevExpress.XtraRichEdit.API.Native;
using DevExpress.XtraRichEdit;
using DevExpress.Office;

static void LineNumbering(RichEditDocumentServer wordProcessor) {

    // Load a document from a file.
    wordProcessor.LoadDocument("Documents\\Grimm.docx", DocumentFormat.Docx);

    // Access a document.
    Document document = wordProcessor.Document;

    // Specify the document’s measure units.
    document.Unit = DevExpress.Office.DocumentUnit.Inch;

    // Access the first document section.
    Section sec = document.Sections[0];

    // Specify line numbering parameters for the section.
    sec.LineNumbering.CountBy = 2;
    sec.LineNumbering.Start = 1;
    sec.LineNumbering.Distance = 0.25f;
    sec.LineNumbering.RestartType = LineNumberingRestart.NewSection;
}
vb
Imports DevExpress.XtraRichEdit.API.Native
Imports DevExpress.XtraRichEdit
Imports DevExpress.Office

Private Shared Sub LineNumbering(ByVal wordProcessor As RichEditDocumentServer)

    ' Load a document from a file.
    wordProcessor.LoadDocument("Documents\Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.Docx)

    ' Access a document.
    Dim document As Document = wordProcessor.Document

    ' Specify the document’s measure units.
    document.Unit = DocumentUnit.Inch

    ' Access the first document section.
    Dim sec As Section = document.Sections(0)

    ' Specify line numbering parameters for the section.
    sec.LineNumbering.CountBy = 2
    sec.LineNumbering.Start = 1
    sec.LineNumbering.Distance = 0.25F
    sec.LineNumbering.RestartType = LineNumberingRestart.NewSection
End Sub

See Also

LineNumbering

CountBy

BeginUpdateParagraphs(DocumentRange)

EndUpdateParagraphs(ParagraphProperties)

ParagraphPropertiesBase Interface

ParagraphPropertiesBase Members

DevExpress.XtraRichEdit.API.Native Namespace