PageSetup.LineNumbering property (Word)

Returns or sets a LineNumbering object that represents the line numbers for the specified PageSetup object.

Syntax

expression. LineNumbering

expression An expression that returns a PageSetup object.

Remarks

You must be in print layout view to see line numbering.

Example

This example enables line numbering for the active document.

ActiveDocument.PageSetup.LineNumbering.Active = True

This example enables line numbering for a document named "MyDocument.doc" The starting number is set to one, every fifth line number is shown, and the numbering is continuous throughout all sections in the document.

set myDoc = Documents("MyDocument.doc") 
With myDoc.PageSetup.LineNumbering 
 .Active = True 
 .StartingNumber = 1 
 .CountBy = 5 
 .RestartMode = wdRestartContinuous 
End With

This example sets the line numbering in the active document equal to the line numbering in MyDocument.doc.

ActiveDocument.PageSetup.LineNumbering = Documents("MyDocument.doc") _ 
 .PageSetup.LineNumbering

See also

PageSetup Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.