Is it possible to use Microsoft.Office.Interop.Wor

2019-06-02 08:59发布

问题:

I would like to use Microsoft.Office.Interop.Word to programatically remove all line numberings from a Word document. (How) is it possible?

Should I use the LineNumbering interface?

回答1:

Line numbering is an document- or section-level setting, and it's controlled over the PageSetup object. To simply turn it off throughout the document:

Word.Document doc = wdApp.ActiveDocument;
doc.PageSetup.LineNumbering.Active = false;