应用于 Row 和 Rows 对象的 SetHeight 方法。
设置表格行的高度。
expression.SetHeight(RowHeight, HeightRule)
expression 必需。该表达式返回以上一个对象。
RowHeight Single 类型,必需。一行或多行的高度,以磅为单位。
HeightRule 必需,WdRowHeightRule。确定指定行的高度的方法。
WdRowHeightRule 可以是下列 WdRowHeightRule 常量之一: |
wdRowHeightAtLeast |
wdRowHeightExactly |
wdRowHeightAuto |
应用于 Cell 和 Cells 对象的 SetHeight 方法。
设定表格单元格的高度。
expression.SetHeight(RowHeight, HeightRule)
expression 必需。该表达式返回以上一个对象。
RowHeight Variant 类型,必需。一行或多行的高度,以磅为单位。
HeightRule 必需,WdRowHeightRule。确定指定单元格高度的方法。
WdRowHeightRule 可以是下列 WdRowHeightRule 常量之一: |
wdRowHeightAtLeast |
wdRowHeightExactly |
wdRowHeightAuto |
注意:设置一个 Cell 或 Cells 对象的 SetHeight 属性将自动设置所在行的该属性。
本示例创建一张表格,然后将第一行高度固定为 0.5 英寸(36 磅)。
Set newDoc = Documents.Add
Set aTable = _
newDoc.Tables.Add(Range:=Selection.Range, NumRows:=3, _
NumColumns:=3)
aTable.Rows(1).SetHeight RowHeight:=InchesToPoints(0.5), _
HeightRule:=wdRowHeightExactly
本示例将所选单元格的行高设为不小于 18 磅。
If Selection.Information(wdWithInTable) = True Then
Selection.Cells.SetHeight RowHeight:=18, _
HeightRule:=wdRowHeightAtLeast
Else
MsgBox "The insertion point is not in a table."
End If