Rectangle.Lines property (Word)

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.

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

Rectangle 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.