expression.PresetGradient(Style, Variant, PresetGradientType)
expression Required. An expression that returns one of the objects in the Applies To list.
Style Required MsoGradientStyle. The style of the gradient.
MsoGradientStyle can be one of these MsoGradientStyle constants. |
msoGradientDiagonalDown |
msoGradientDiagonalUp |
msoGradientFromCenter |
msoGradientFromCorner |
msoGradientFromTitle |
msoGradientHorizontal |
msoGradientMixed Not used with this method. |
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 msoGradientFromTitle or msoGradientFromCenter, this argument can be either 1 or 2.
PresetGradientType Required MsoPresetGradientType. The gradient type.
MsoPresetGradientType can be one of these MsoPresetGradientType constants. |
msoGradientBrass |
msoGradientCalmWater |
msoGradientChrome |
msoGradientChromeII |
msoGradientDaybreak |
msoGradientDesert |
msoGradientEarlySunset |
msoGradientFire |
msoGradientFog |
msoGradientGold |
msoGradientGoldII |
msoGradientHorizon |
msoGradientLateSunset |
msoGradientMahogany |
msoGradientMoss |
msoGradientNightfall |
msoGradientOcean |
msoGradientParchment |
msoGradientPeacock |
msoGradientRainbow |
msoGradientRainbowII |
msoGradientSapphire |
msoGradientSilver |
msoGradientWheat |
msoPresetGradientMixed Not used with this method. |
Example
This example adds a rectangle with a preset gradient fill to the active publication.
ActiveDocument.Pages(1).Shapes _
.AddShape(msoShapeRectangle, 90, 90, 140, 80) _
.Fill.PresetGradient Style:=msoGradientHorizontal, _
Variant:=1, PresetGradientType:=msoGradientBrass