Line 属性

       

返回一个 LineFormat 对象,该对象包含指定图形的线条格式属性。对于直线,LineFormat 对象代表该直线本身;对于带有边框的图形,LineFormat 对象代表其边框。只读。

示例

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

Set myDocument = Worksheets(1)
With myDocument.Shapes.AddLine(10, 10, 250, 250).Line
    .DashStyle = msoLineDashDotDot
    .ForeColor.RGB = RGB(50, 0, 128)
End With

本示例向 myDocument 中添加十字,然后将其边框设置为 8 磅粗的红色线条。

Set myDocument = Worksheets(1)
With myDocument.Shapes.AddShape(msoShapeCross, 10, 10, 50, 70).Line
    .Weight = 8
    .ForeColor.RGB = RGB(255, 0, 0)
End With