Class Line (Word VBA)

The class Line represents an individual line in a Rectangle object of type wdTextRectangle. Use the Line object and related methods and properties to programmatically define page layout in a document.

For Each

Here is an example of processing the Line items in a collection.

Dim shp As Rectangle: Set shp = 
Dim lin As Line
For Each lin In shp.Lines
	With lin
		
	End With
Next lin

Properties

Height returns or sets the height of a line.

7 
Dim lngHeight As Long
lngHeight = lin.Height

Left returns a Long that represents the number of pixels from the left edge of the page to the left edge of a line.

7 
Dim lngLeft As Long
lngLeft = lin.Left

LineType returns a wdLineType constant that indicates whether a line is a text line or a table row.

7 
Dim wltLineType As WdLineType
wltLineType = lin.LineType

Parent returns an object that represents the parent object of the specified Line object.

7 
Dim objParent As Object
Set objParent = lin.Parent

Range returns a Range object that represents the portion of a document that is contained within a line.

7 
Dim rngRange As Range
Set rngRange = lin.Range

Rectangles returns a Rectangles collection that represents a portion of text or graphics in a page in a document.

7 
Dim rctsRectangles As Rectangles
Set rctsRectangles = lin.Rectangles

Top returns a Long that represents the number of pixels from the top of the page to the top of a line.

7 
Dim lngTop As Long
lngTop = lin.Top

Width returns or sets the width, in points, of a line.

7 
Dim lngWidth As Long
lngWidth = lin.Width

Lines.Count returns a Long that represents the number of lines in the collection.

Dim lns As Lines: Set lns =  
Dim lngCount As Long
lngCount = lns.Count

Lines.Parent returns an object that represents the parent object of the specified Lines object.

Dim lns As Lines: Set lns =  
Dim objParent As Object
Set objParent = lns.Parent