PresetGradient Method

Microsoft Word Visual Basic

Sets the specified fill to a preset gradient.

expression.PresetGradient(Style, Variant, PresetGradientType)

expression    Required. An expression that returns a FillFormat object.

Style   Required MsoGradientStyle. The gradient style.

MsoGradientStyle can be one of these MsoGradientStyle constants.
msoGradientDiagonalDown
msoGradientDiagonalUp
msoGradientFromCenter
msoGradientFromCorner
msoGradientFromTitle Only used in Microsoft PowerPoint.
msoGradientHorizontal
msoGradientMixed
msoGradientVertical

Variant   Required Long. The gradient variant. Can be a value from 1 to 4, corresponding to the four variants on the Gradient tab in the Fill Effects dialog box. If Style is msoGradientFromCenter, this argument can be either 1 or 2.

PresetGradientType   Required MsoPresetGradientType. The gradient type.

MsoPresetGradientType can be one of these MsoPresetGradientType constants.
msoGradientBrass
msoGradientChrome
msoGradientDaybreak
msoGradientEarlySunset
msoGradientFog
msoGradientGoldII
msoGradientLateSunset
msoGradientMoss
msoGradientOcean
msoGradientPeacock
msoGradientRainbowII
msoGradientSilver
msoGradientWheat
msoPresetGradientMixed
msoGradientCalmWater
msoGradientChromeII
msoGradientDesert
msoGradientFire
msoGradientGold
msoGradientHorizon
msoGradientMahogany
msoGradientNightfall
msoGradientParchment
msoGradientRainbow
msoGradientSapphire

Example

This example adds a rectangle with a preset gradient fill to the active document.

ActiveDocument.Shapes.AddShape( _
    msoShapeRectangle, 90, 90, 140, 80).Fill.PresetGradient _
    msoGradientHorizontal, 1, msoGradientBrass