Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Line Object (Word)

Represents an individual line in a Rectangle object of type wdTextRectangle. Use the Line object and related methods and properties to programmatically define page layout in a document.

Use the Item method to return a specific Line object. The following example accesses the first line in the first rectangle in the first page of the active document.

Dim objLine As Line 
Set objLine = ActiveDocument.ActiveWindow _ 

Use the LineType property to determine whether the specified line is a text line (wdTextLine) or a table row (wdTableRow). Then use the Range property to access the contents and formatting for the line. The following example creates a reference to the table if the specified line type is wdTableRow.

Dim objLine As Line 
Dim objTable As Table 
Set objLine = ActiveDocument.ActiveWindow _ 
If objLine.LineType = wdTableRow Then _ 
 Set objTable = objLine.Range.Tables(1)

Community Additions

© 2014 Microsoft. All rights reserved.