I can manually set an object's line color in PowerPoint to have a gradient "fill" and varying transparency, just as I can for the object's fill. However, I can't figure out how to do that using VBA. I have the code for the fill working fine, but I'm not sure what object to access to set the line to use a gradient. Since Microsoft kindly removed recording capability, there is no easy way to get an example.
Can someone provide me the basics of setting a line to have a gradient?
Fill example that sets a gradient fill with varying transparency:
Set GradientShapeFill = theShape.Fill
With GradientShapeFill
.ForeColor.RGB = RGB(0, 128, 128)
.OneColorGradient msoGradientVertical, 1, 1
scaleHSL.Hue = tHSL.Hue
scaleHSL.Saturation = myMin(tHSL.Saturation, 0.99999)
scaleHSL.Luminance = tHSL.Luminance * 0.7
tRGB = HSLtoRGB(scaleHSL)
.GradientStops.insert RGB(tRGB.Red, tRGB.Green, tRGB.Blue), 0#
scaleHSL.Hue = tHSL.Hue
scaleHSL.Saturation = myMin(tHSL.Saturation, 0.99999)
scaleHSL.Luminance = tHSL.Luminance * 0.85
tRGB = HSLtoRGB(scaleHSL)
.GradientStops.insert RGB(tRGB.Red, tRGB.Green, tRGB.Blue), 0.5
scaleHSL.Hue = tHSL.Hue
scaleHSL.Saturation = myMin(tHSL.Saturation, 0.99999)
scaleHSL.Luminance = tHSL.Luminance
tRGB = HSLtoRGB(scaleHSL)
.GradientStops.insert RGB(tRGB.Red, tRGB.Green, tRGB.Blue), 1#
.GradientStops.Delete 2
.GradientStops.Delete 1
.GradientStops(1).Transparency = 1#
.GradientStops(2).Transparency = 0.33
.GradientStops(3).Transparency = 0#
.RotateWithObject = msoFalse
End With
Thanks,
Eric