Excel) (Shape.Line 属性

返回包含指定形状的线条格式属性的 LineFormat 对象。 (对于线条, LineFormat 对象表示线条本身;对于带边框的形状, LineFormat 对象表示边框) 。 此为只读属性。

语法

表达式。折线图

expression 一个代表 Shape 对象的变量。

示例

以下示例向 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

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。