user2076996
user2076996

Reputation: 53

Powerpoint vba to change text gradient?

Is there anything in Powerpoint vba (2007 or 2010) that lets you set or change the gradient colors on a text object (the text itself)? All I can find are presetTextEffect settings. Thanks.

Upvotes: 2

Views: 837

Answers (1)

Kazimierz Jawor
Kazimierz Jawor

Reputation: 19067

Is this what you need?...

enter image description here

If so, here is the code which I made it with. You will need to improve it accordingly. There are plenty of formatting possibilities when applying gradient formation. Therefore I will suggest to experiment and checking VBA help for additional information.

Sub Test()
    Dim TXTbox As Shape
    Set TXTbox = ActivePresentation.Slides(1).Shapes(1)

        With TXTbox.TextFrame2.TextRange.Font.Fill
            .ForeColor.RGB = RGB(0, 128, 128)
            .OneColorGradient msoGradientHorizontal, 1, 1
        End With

End Sub

Upvotes: 1

Related Questions