Share via


BaseRGB Property [Publisher 2003 VBA Language Reference]

Returns or sets an MsoRGBType constant that represents the original RGB color format before color-changing properties, such as tinting and shading, are applied. Read/write.

expression.BaseRGB

expression Required. An expression that returns one of the objects in the Applies To list.

Example

This example creates a shape, sets the fill color and lightens the color; then it creates a second shape and applies the original RGB color of the first shape to the second shape.

Sub SetBaseRGB()
    Dim shpOne As Shape

    With ActiveDocument.Pages(1).Shapes
        Set shpOne = .AddShape(Type:=msoShapeHeart, _
            Left:=150, Top:=150, Width:=300, Height:=300)
        With shpOne.Fill.ForeColor
            .RGB = RGB(Red:=160, Green:=0, Blue:=255)
            .TintAndShade = 0.9
        End With
        .AddShape(Type:=msoShapeRectangle, Left:=62, _
            Top:=500, Width:=488, Height:=100).Fill _
            .ForeColor.RGB = shpOne.Fill.ForeColor.BaseRGB
    End With
End Sub

Applies to | ColorFormat Object