This example shows how the RGB function is used to return a whole number representing an RGB color value. It is used for those application methods and properties that accept a color specification. The object MyObject
and its property are used for illustration purposes only. If MyObject
does not exist, or if it does not have a Color property, an error occurs.
Dim RED, I, RGBValue, MyObject
Red = RGB(255, 0, 0) ' Return the value for Red.
I = 75 ' Initialize offset.
RGBValue = RGB(I, 64 + I, 128 + I) ' Same as RGB(75, 139, 203).
MyObject.Color = RGB(255, 0, 0) ' Set the Color property of
' MyObject to Red.