AddLine 方法

       

创建线条。返回一个代表新线条的 Shape 对象。

expression.AddLine(BeginX, BeginY, EndX, EndY)

expression  必选。该表达式返回“应用于”列表中的对象之一。

BeginX 必选。Single 类型。线条起点相对于幻灯片左边缘的水平位置(以磅为单位)。

BeginY  必选。Single 类型。线条起点相对于幻灯片上边缘的垂直位置(以磅为单位)。

EndX  必选。Single 类型。线条终点相对于幻灯片左边缘的水平位置(以磅为单位)。

EndY  必选。Single 类型。线条终点相对于幻灯片上边缘的垂直位置(以磅为单位)。

示例

本示例向 myDocument 中添加蓝色的虚线。

Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes.AddLine(BeginX:=10, BeginY:=10, _
        EndX:=250, EndY:=250).Line
    .DashStyle = msoLineDashDotDot
    .ForeColor.RGB = RGB(50, 0, 128)
End With