Alex
Alex

Reputation: 535

VBA in PowerPoint: ColorIndex to change textcolor?

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

Answers (1)

Chronocidal
Chronocidal

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

Related Questions