The following VBA example selects an object in the active document and determines if the object is a curve object. If the selection is a curve, it changes its Closed status to True, joining all of the segments in the shape to make a self-contained object. A color fountain fill is then applied to the new closed curve object using the
Application.CreateColorEx method.
Sub CurveClosed()
Dim s As Shape
Set s = ActiveSelection.Shapes(1)
If s.Type = cdrCurveShape Then
s.Curve.Closed = True
End If
s.Fill.ApplyFountainFill CreateColorEx(5005, 255, 0, 0), _
CreateColorEx(5005, 0, 0, 0), 1
End Sub