Share via


Lines Collection

Word Developer Reference

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

Remarks

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.

Visual Basic for Applications
  Dim objLines As Lines

Set objLines = ActiveDocument.ActiveWindow.Panes(1) _ .Pages(1).Rectangles(1).Lines

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.

Visual Basic for Applications
  Dim objRectangle As Rectangle
Dim objLines As Lines

Set objRectangle = ActiveDocument.ActiveWindow _ .Panes(1).Pages(1).Rectangles(1)

If objRectangle.RectangleType = wdTextRectangle Then _ Set objLines = objRectangle.Lines

See Also