Lines Method

See Also         Example         Applies To

Returns a TextRange object that represents the specified subset of text lines. For information about counting or looping through the lines in a text range, see the TextRange object.

Syntax

expression.Lines(Start, Length)

expression   Required. An expression that returns a TextRange object.

Start   Optional Long. The first line in the returned range.

Length   Optional Long. The number of lines to be returned.

Remarks

If both Start and Length are omitted, the returned range starts with the first line and ends with the last paragraph in the specified range.

If Start is specified but Length is omitted, the returned range contains one line.

If Length is specified but Start is omitted, the returned range starts with the first line in the specified range.

If Start is greater than the number of lines in the specified text, the returned range starts with the last line in the specified range.

If Length is greater than the number of lines from the specified starting line to the end of the text, the returned range contains all those lines.