Share via


FillFormat.GradientStyle Property (Word)

Returns the gradient style for the specified fill. Read-only MsoGradientStyle.

Syntax

expression .GradientStyle

expression An expression that represents a FillFormat object.

Remarks

This property is read-only. Use the OneColorGradient or TwoColorGradient method to set the gradient style for the fill.

Attempting to return this property for a fill that doesn't have a gradient generates an error. Use the Type property to determine whether the fill has a gradient.

Example

This example adds a rectangle to the active document and sets its fill gradient style to match that of the shape named "rect1." For the example to work, rect1 must have a gradient fill.

Dim docActive As Document 
Dim lngGradient As Long 
 
Set docActive = ActiveDocument 
With docActive.Shapes 
 lngGradient = .Item("rect1").Fill.GradientStyle 
 With .AddShape(msoShapeRectangle, 0, 0, 40, 80).Fill 
 .ForeColor.RGB = RGB(128, 0, 0) 
 .OneColorGradient lngGradient, 1, 1 
 End With 
End With

See Also

Concepts

FillFormat Object

FillFormat Object Members