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

Set myOval = ActiveDocument.Shapes(1)
With myOval.WrapFormat
    .Type = wpsWrapSquare
    .Side = wpsWrapBoth
    .DistanceTop = InchesToPoints(0.1)
    .DistanceBottom = InchesToPoints(0.1)
    .DistanceLeft = InchesToPoints(0.1)
    .DistanceRight = InchesToPoints(0.1)
End With