DistanceRight 属性

       

对于 Rows 对象:返回或设置指定文档右边缘与文档文字之间的距离(以磅为单位)。如果 WrapAroundTextFalse,则该属性无效。Single 类型,可读写。

对于 WrapFormat 对象:返回或设置文档文字与指定图形周围的非文本区右边缘之间的距离(以磅为单位)。非文本区的大小和图形,取决于所指定图形的大小和形状,以及 WrapFormat 对象的 TypeSide 属性。Single 类型,可读写。

示例

本示例设定文字环绕在活动文档中第一个表格的周围,并且环绕文字与该表格各边的间距为 20 磅。

With ActiveDocument.Tables(1).Rows
    .WrapAroundText = True
    .DistanceLeft = 20
    .DistanceRight = 20
    .DistanceTop = 20
    .DistanceBottom = 20
End With

本示例在活动文档中添加一个椭圆,并指定文档文字环绕该椭圆外接矩形的左右两侧。本示例将文档文字与该外接矩形四边之间的边距设置为 0.1 英寸。

Dim shapeOval As Shape

Set shapeOval = ActiveDocument.Shapes.AddShape(msoShapeOval, _
    0, 0, 200, 50)
With shapeOval.WrapFormat
    .Type = wdWrapSquare
    .Side = wdWrapBoth
    .DistanceTop = InchesToPoints(0.1)
    .DistanceBottom = InchesToPoints(0.1)
    .DistanceLeft = InchesToPoints(0.1)
    .DistanceRight = InchesToPoints(0.1)
End With