TwoColorGradient Method Example

This example adds a rectangle with a two-color gradient fill to myDocument and sets the background and foreground color for the fill.

Set myDocument = ActiveDocument
With myDocument.Shapes.AddShape(msoShapeRectangle, _
        0, 0, 40, 80).Fill
    .ForeColor.RGB = RGB(128, 0, 0)
    .BackColor.RGB = RGB(0, 170, 170)
    .TwoColorGradient msoGradientHorizontal, 1
End With