Lines Object
Collapse the table of content
Expand the table of content

Lines Object (Word)

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

A collection of Line objects that represents the lines in a Rectangle object that is of type wdTextRectangle.

Use the Lines property to return a collection of lines for a specified rectangle. The following example accesses the lines in the first rectangle in the first page in the active document.

Dim objLines As Lines 
Set objLines = ActiveDocument.ActiveWindow.Panes(1) _ 

Use the RectangleType property of the specified Rectangle object to determine whether the Rectangle object is of type wdTextRectangle. The following example returns the collection of lines in the first rectangle in the first page of the active document if the specified rectangle contains text.

Dim objRectangle As Rectangle 
Dim objLines As Lines 
Set objRectangle = ActiveDocument.ActiveWindow _ 
If objRectangle.RectangleType = wdTextRectangle Then _ 
 Set objLines = objRectangle.Lines
© 2016 Microsoft