FillFormat.GradientStyle 屬性 (Publisher)

傳回 MsoGradientStyle 常數,指出指定填滿的漸層樣式。 唯讀。

語法

運算式。GradientStyle

運算式 代表 FillFormat 物件的變數。

傳回值

MsoGradientStyle

註解

使用 OneColorGradient、 PresetGradient 或 TwoColorGradient 方法來設定填色的漸層樣式。

若嘗試對沒有漸層的填滿傳回此屬性,則會產生錯誤。 使用 Type 屬性即可判斷填滿是否有漸層。

GradientStyle 屬性值可以是 Microsoft Office 類型程式庫中所宣告的 MsoGradientStyle 常數之一。

範例

本範例在目前出版物中新增一個矩形,並將其填滿設為與 rect1 圖案一樣的漸層樣式。 為使本範例能正常執行,rect1 必須有漸層填滿設定。

Dim intStyle As Integer 
 
With ActiveDocument.Pages(1).Shapes 
 ' Store gradient style of rect1. 
 intStyle = .Item("rect1").Fill.GradientStyle 
 ' Add new rectangle. 
 With .AddShape(Type:=msoShapeRectangle, _ 
 Left:=0, Top:=0, Width:=40, Height:=80).Fill 
 ' Set color and gradient of new rectangle. 
 .ForeColor.RGB = RGB(128, 0, 0) 
 .OneColorGradient Style:=intStyle, _ 
 Variant:=1, Degree:=1 
 End With 
End With 

支援和意見反應

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