Share via


Rectangle.Lines Property

Word Developer Reference

Returns a Lines collection that represents the lines in a specified portion of text in a page.

Syntax

expression.Lines

expression   An expression that returns a Rectangle object.

Remarks

Use the Lines collection and related objects and properties to programmatically define page layout in a document.

Example

The following example accesses 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