Skip to content
本页内容

DashStyle (属性)

返回或设置指定直线的虚线样式。可以是 MsoLineDashStyle 常量之一。可读/写 int 类型。

示例

python
#本示例向第一张工作表中添加蓝色的虚线
def test():
    worksheet = Application.Worksheets.Item(1)
    line = worksheet.Shapes.AddLine(10, 10, 250, 250).Line
    line.DashStyle = msoLineDashDotDot
    line.ForeColor.RGB = RGB(50, 0, 128)
python
#本示例向活动工作表添加一条红色实线
def test():
    shapes = ActiveSheet.Shapes
    shape = shapes.AddLine(100, 10, 27, 230)
    shape.Line.DashStyle = msoLineSolid
    shape.Line.ForeColor.RGB = RGB(255, 0, 0)