共用方式為


GradientStops.Insert 方法 (Office)

會將停駐點新增至漸層。

語法

運算式插入 (RGB位置透明度索引)

表達 會傳回 GradientStops 物件的 運算式。

參數

名稱 必要/選用 資料類型 描述
RGB 必要 MsoThemeColorSchemeIndex 會指定漸層停止點的色彩。
Position 必要 Single 會指定以百分比表示之漸層內的停止點位置。
Transparency 選用 Single 會指定漸層停駐點色彩的不透明度。
Index 選用 Long 停駐點的索引編號。

註解

漸層是從某個色彩狀態順利地轉換到另一個。 這些區段的端點稱為停止點。

範例

下列範例會在 Microsoft PowerPoint 中建立三個色彩漸層停駐點。

Sub gradients() 
 Set myDocument = ActivePresentation.Slides(1) 
 Set GradientShapeFill = myDocument.Shapes.AddShape(msoShapeRectangle, 90, 90, 90, 80).Fill 
 With GradientShapeFill 
 .ForeColor.RGB = RGB(0, 128, 128) 
 .OneColorGradient msoGradientHorizontal, 1, 1 
 .GradientStops.Insert RGB(255, 0, 0), 0.25 
 .GradientStops.Insert RGB(0, 255, 0), 0.5 
 .GradientStops.Insert RGB(0, 0, 255), 0.75 
 End With 
End Sub 

另請參閱

支援和意見反應

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