Share via


GradientDegree Property [Publisher 2003 VBA Language Reference]

Returns a Single indicating how dark or light a one-color gradient fill is. A value of 0 (zero) means that black is mixed in with the shape's foreground color to form the gradient; a value of 1 means that white is mixed in; and values between 0 and 1 mean that a darker or lighter shade of the foreground color is mixed in. Read-only.

expression.GradientDegree

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

Remarks

Use the OneColorGradient method to set the gradient degree for the fill.

Example

This example adds a rectangle to the active publication and sets the degree of its fill gradient to match that of the shape named Rectangle 2. If Rectangle 2 doesn't have a one-color gradient fill, this example generates an error.

Dim sngDegree As Single

With ActiveDocument.Pages(1).Shapes
    ' Store degree of one-color gradient.
    sngDegree = .Item("Rectangle 2").Fill.GradientDegree
    ' Add new rectangle.
    With .AddShape(msoShapeRectangle, 0, 0, 40, 80).Fill
        ' Set color and gradient for new rectangle.
        .ForeColor.RGB = RGB(128, 0, 0)
        .OneColorGradient Style:=msoGradientHorizontal, _
            Variant:=1, Degree:=sngDegree
    End With
End With

Applies to | FillFormat Object