PowerPoint) (FillFormat.GradientVariant 屬性
會對大多數的漸層填滿,將指定之填滿的漸層變數傳回為 1 到 4 的整數值。 唯讀。
語法
運算式。GradientVariant
表達 代表 FillFormat 物件的 變數。
傳回值
Long
註解
如果漸層樣式為 msoGradientFromTitle 或 msoGradientFromCenter ,則此屬性會傳回 1 或 2。
此屬性的值會對應至在 圖案填滿] 索引標籤 長漸層停駐子標籤上的漸層變化 (從左到右和從上到下編號)。
此屬性是唯讀的。 使用 OneColorGradient、PresetGradient 或 TwoColorGradient 方法,即可設定填滿的漸層變數。
範例
此範例會將矩形新增至 myDocument,並且將它的填滿漸層變數設定為與名為 "rect1" 之圖案的填滿漸層樣式相符。rect1 必須有漸層填滿,此範例才有作用。
Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes
gradVar1 = .Item("rect1").Fill.GradientVariant
With .AddShape(msoShapeRectangle, 0, 0, 40, 80).Fill
.ForeColor.RGB = RGB(128, 0, 0)
.OneColorGradient msoGradientHorizontal, gradVar1, 1
End With
End With
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。