GradientVariant Property Example

This example adds a rectangle to myDocument and sets its fill gradient variant to match that of the shape named "rect1." For the example to work, rect1 must have a gradient fill.

With ActiveDocument.Shapes
    gradVar1 = .Item("rect1").Fill.GradientVariant
    With .AddShape(msoShapeRectangle, 0, 0, 40, 80).Fill
        .ForeColor.RGB = RGB(128, 0, 0)
        .OneColorGradient msoGradientHorizontal, gradVar1, 1
    End With
End With