officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-paragraphpropertiesbase-4792b2c0.md
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
bool? SuppressLineNumbers { get; set; }
Property SuppressLineNumbers As Boolean?
| Type | Description |
|---|---|
| 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.
|
To enable line numbering, set the SectionLineNumbering.CountBy for the section encompassing the paragraph to a positive integer greater than zero.
View Example: Word Processing Document API – How to Process Word Documents in Code
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;
}
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
BeginUpdateParagraphs(DocumentRange)
EndUpdateParagraphs(ParagraphProperties)
ParagraphPropertiesBase Interface