Free Support Forum -

[.NET] Removal of line numbers in .doc file


I’d like to know if with Aspose Word for .NET is possible to remove the line numbers from a .doc (Word 2003) file, obraining a result similar to the one obtained with following code using Word Interop:


Bets regards,


Thanks for your inquiry. You can remove line numbering from word document by setting the value of PageSetup.LineNumberCountBy property to 0. Please check the following code example. Hope this helps you.

Document doc = new Document(MyDir + "in.docx");
foreach (Section section in doc.Sections)
    section.PageSetup.LineNumberCountBy = 0;
doc.Save(MyDir + "18.11.docx");

Perfect. Thanks!