GradientColorType Property

Microsoft PowerPoint Visual Basic

GradientColorType Property

       

Returns the gradient color type for the specified fill. This property is read-only. Use the OneColorGradient, PresetGradient, or TwoColorGradient method to set the gradient type for the fill. Read-only MsoGradientColorType.

MsoGradientColorType can be one of these MsoGradientColorType constants.
msoGradientColorMixed
msoGradientOneColor
msoGradientPresetColors
msoGradientTwoColors

expression.GradientColorType

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

This example changes the fill for all shapes in myDocument that have a two-color gradient fill to a preset gradient fill.

Set myDocument = ActivePresentation.Slides(1)
For Each s In myDocument.Shapes
    With s.Fill
        If .GradientColorType = msoGradientTwoColors Then
            .PresetGradient msoGradientHorizontal, _
                1, msoGradientBrass
        End If
    End With
Next