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.
Remarks
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 _
.Panes(1).Pages(1).Rectangles(1).Lines.Item(1)
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 _
.Panes(1).Pages(1).Rectangles(1).Lines.Item(1)
If objLine.LineType = wdTableRow Then _
Set objTable = objLine.Range.Tables(1)
See also
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.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for