FillFormat.PresetGradientType property (Publisher)
Returns an MsoPresetGradientType constant that represents the preset gradient type for the specified fill. Read-only.
Syntax
expression.PresetGradientType
expression A variable that represents a FillFormat object.
Return value
MsoPresetGradientType
Remarks
The PresetGradientType property value can be one of the MsoPresetGradientType constants declared in the Microsoft Office type library.
Use the PresetGradient method to set the preset gradient type for the fill.
Example
This example changes the fill for the first shape on the first page of the active publication to the Fog preset gradient fill if it is not already set to the Fog preset gradient. This example assumes that there is at least one shape on the first page of the active publication.
Sub SetGradient()
With ActiveDocument.Pages(1).Shapes(1).Fill
If .PresetGradientType <> msoGradientFog Then
.PresetGradient Style:=msoGradientHorizontal, _
Variant:=1, PresetGradientType:=msoGradientFog
End If
End With
End Sub
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.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for