Reputation: 535
I'm copy pasting data from Excel into a PowerPoint presentation using VBA. Now I have added a textbox and want to change the color of the text within it. It works when using "vbBlack" or RGB
myPresentation.Slides(1).Shapes(1).TextFrame.TextRange.Font.Color = vbBlack
myPresentation.Slides(1).Shapes(1).TextFrame.TextRange.Font.Color = RGB(255, 0, 0)
However, can I use ColorIndex for this? When I try it says it doesn't recognize the method.
Upvotes: 0
Views: 641
Reputation: 7951
Powerpoint does not include the ColorIndex
property in the ColorFormat
. However, it does include the ColorConstants
enum.
You can also use SchemeColor
or ObjectThemeColor
You would need to set a cell to ColorIndex
, and then retrieve the Color
to get the RGB value.
Upvotes: 1