Text Documents (Writer)
HTML Documents (Writer Web)
Spreadsheets (Calc)
Presentations (Impress)
Drawings (Draw)
Database Functionality (Base)
Formulae (Math)
Charts and Diagrams
Macros and Scripting
Office Installation
Common Help Topics
OneOffice Logo

QBColor Function

Returns the RGB colour code of the colour passed as a colour value through an older MS-DOS based programming system.

Syntax:

QBColor (ColourNumber As Integer)

Return value:

Long

Parameters:

ColourNumber: An integer expression that specifies the colour value of the colour passed from an older MS-DOS based programming system.

ColourNumber can be assigned the following values:

0 : Black

1 : Blue

2 : Green

3 : Cyan

4 : Red

5 : Magenta

6 : Yellow

7 : White

8 : Grey

9 : Light Blue

10 : Light Green

11 : Light Cyan

12 : Light Red

13 : Light Magenta

14 : Light Yellow

15 : Bright White

This function is used only to convert from older MS-DOS based BASIC applications that use the above colour codes. The function returns a long integer value indicating the colour to be used in the Office IDE.

Error codes:

5 Invalid procedure call

Example:


Sub ExampleQBColor
Dim iColor As Integer
Dim sText As String
    iColor = 7
    sText = "RGB= " & Red(QBColor( iColor) ) & ":" & Blue(QBColor( iColor) ) & ":" & Green(QBColor( iColor) )
    MsgBox stext,0,"Colour " & iColour
End Sub