BaseRGB Property

Microsoft Publisher Visual Basic

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