This example turns on line numbering for the active document. The line number is displayed on every fifth line and line numbering starts over for each new section.
With ActiveDocument.PageSetup.LineNumbering
.Active = True
.CountBy = 5
.RestartMode = wdRestartSection
End With