SetLeftIndent Method
Applies To
Row object, Rows collection object.
Description
Sets the indentation for a row or rows in a table.
Syntax
expression.SetLeftIndent(LeftIndent, RulerStyle)
expression Required. An expression that returns a Row or Rows object.
LeftIndent Required Single. The distance (in points) between the left page margin and the left edge of the specified row or rows.
RulerStyle Required Long. Controls the way Word adjusts the table when the left indent is changed. Can be one of the following WdRulerStyle constants.
Constant | Description |
|
wdAdjustFirstColumn | Preserves the position of the right edge of the table by narrowing cells in the first column only. |
wdAdjustNone | Moves cells to the right. This is the default value. |
wdAdjustProportional | Preserves the position of the right edge of the table by narrowing all the cells in the specified rows in proportion to their widths. |
wdAdjustSameWidth | Preserves the position of the right edge of the table by narrowing all the cells in the specified rows, assigning the same width to all of them. |
See Also
AutoFormat method, LeftIndent property, LeftMargin property.
Example
This example creates a table in a new document and indents the first row 0.5 inch (36 points). When you change the left indent, the cell widths are adjusted to preserve the right edge of the table.
Set aDoc = Documents.Add
Set myTable = aDoc.Tables.Add(Range:=Selection.Range, NumRows:=3, _
NumColumns:=3)
myTable.Rows(1).SetLeftIndent LeftIndent:=InchesToPoints(0.5), _
RulerStyle:=wdAdjustSameWidth
This example indents the first row in table one in the active document 18 points, and it narrows the width of the first column to preserve the position of the right edge of the table.
If ActiveDocument.Tables.Count >= 1 Then
ActiveDocument.Tables(1).Rows.SetLeftIndent LeftIndent:=18, _
RulerStyle:=wdAdjustFirstColumn
End If