FillFormat.GradientColorType property (Publisher)

Returns an MsoGradientColorType constant indicating the gradient color type for the specified fill. Read-only.

Syntax

expression.GradientColorType

expression A variable that represents a FillFormat object.

Return value

MsoGradientColorType

Remarks

Use the OneColorGradient, PresetGradient, or TwoColorGradient method to set the gradient type for the fill.

The GradientColorType property value can be one of the MsoGradientColorType constants declared in the Microsoft Office type library.

Example

This example changes the fill for all shapes on the first page of the active publication that have a two-color gradient fill to a preset gradient fill.

Dim shpLoop As Shape 
 
' Loop through collection of shapes. 
For Each shpLoop In ActiveDocument.Pages(1).Shapes 
 With shpLoop.Fill 
 ' Test for two-color gradient. 
 If .GradientColorType = msoGradientTwoColors Then 
 ' Apply a preset gradient. 
 .PresetGradient Style:=msoGradientHorizontal, _ 
 Variant:=1, PresetGradientType:=msoGradientBrass 
 End If 
 End With 
Next shpLoop 

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.