RGBColor.RGB property (PowerPoint)

Returns or sets the red-green-blue (RGB) value of a specified color-scheme color or extra color when used with a PpColorSchemeIndex constant. Read/write.

Syntax

expression. RGB

expression A variable that represents a RGBColor object.

Return value

MsoThemeColorSchemeIndex

Remarks

Use the Colors method to return a RGBColor object.

The value of the RGB property can be one of these PpColorSchemeIndex constants.

ppAccent1
ppAccent2
ppAccent3
ppBackground
ppFill
ppForeground
ppShadow
ppTitle

Example

This example displays the value of the red, green, and blue components of the fill forecolor for shape one on slide one in the active document.

Set myDocument = ActivePresentation.Slides(1)

c = myDocument.Shapes(1).Fill.ForeColor.RGB

redComponent = c Mod 256

greenComponent = c \ 256 Mod 256

blueComponent = c \ 65536 Mod 256

MsgBox "RGB components: " & redComponent & _
    ", " & greenComponent & ", " & blueComponent

See also

RGBColor Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.