Click or drag to resize
LineNumberRestartMode Enumeration
Determines when automatic line numbering restarts.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.11
Syntax
public enum LineNumberRestartMode
Members
  Member nameValueDescription
RestartPage0 Line numbering restarts at the start of every page.
RestartSection1 Line numbering restarts at the section start.
Continuous2 Line numbering continuous from the previous section.
Remarks
Examples
Turns on Microsoft Word line numbering for a section.
DocumentBuilder builder = new DocumentBuilder();

PageSetup ps = builder.PageSetup;
ps.LineStartingNumber = 1;
ps.LineNumberCountBy = 5;
ps.LineNumberRestartMode = LineNumberRestartMode.RestartPage;
ps.LineNumberDistanceFromText = 50.0d;

// The line counter will skip any paragraph with this flag set to true
Assert.False(builder.ParagraphFormat.SuppressLineNumbers);

for (int i = 1; i <= 20; i++)
    builder.Writeln(string.Format("Line {0}.", i));

builder.Document.Save(ArtifactsDir + "PageSetup.LineNumbers.docx");
See Also