Share via


FillFormat.GradientColorType Property

Publisher Developer Reference

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.

Visual Basic for Applications
  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

See Also