Share via


PowerPoint) (ShapeRange.Line 屬性

會傳回 LineFormat 物件,其中包含指定圖案的線條格式設定屬性。 (對於線條而言, LineFormat 物件代表線條本身;對於具有框線的圖案, LineFormat 物件代表 border.) 唯讀的。

語法

運算式

表達 代表 ShapeRange 物件的 變數。

傳回值

LineFormat

範例

本範例會在 myDocument 中新增藍色的虛線。

Set myDocument = ActivePresentation.Slides(1)

With myDocument.Shapes.AddLine(10, 10, 250, 250).Line

    .DashStyle = msoLineDashDotDot

    .ForeColor.RGB = RGB(50, 0, 128)

End With

在這個範例中,會將一個十字形新增至第一張投影片,然後將它的框線設為 8 點及紅色。

Set myDocument = ActivePresentation.Slides(1)

With myDocument.Shapes.AddShape(msoShapeCross, 10, 10, 50, 70).Line

    .Weight = 8

    .ForeColor.RGB = RGB(255, 0, 0)

End With

另請參閱

ShapeRange 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應