Share via


ColorFormat.RGB Property (Word)

Returns or sets the red-green-blue (RGB) value of the specified color. Read/write Long.

Syntax

expression .RGB

expression A variable that represents a ColorFormat object.

Example

This example sets the color of the second shape in the active document to gray.

ActiveDocument.Shapes(2).Fill.ForeColor.RGB = RGB(128, 128, 128)

This example sets the color of the shadow for Rectangle 1 in the active document to blue.

ActiveDocument.Shapes("Rectangle 1").Shadow.ForeColor.RGB = _ 
 RGB(0, 0, 255)

This example returns the value of the foreground color of the first shape in the active document.

MsgBox ActiveDocument.Shapes(1).Fill.ForeColor.RGB

See Also

Concepts

ColorFormat Object

ColorFormat Object Members