Technical Reference > Graphics Builder Automation Interface > Text Property Functions > AttributeTextOnColourEx

AttributeTextOnColourEx

Applies the "on" color to the selected text, or retrieves the current font color setting.

Syntax

AttributeTextOnColourEx(TextColour)

TextColour:

An RGB value.

Return Value

If retrieving the current font color, an RGB value. If applying a particular font color, 0 (zero) if successful. In both cases, an error is returned if unsuccessful. If values are out of range on writing to the attribute, the function exits and reports the error E_INVALIDARG. If there is no active text object, these functions throw an exception with a return value of E_HANDLE.

Note: For details on handling return and error values, see Error Handling.

Related Functions

AttributeText, AttributeTextStyle, AttributeTextJustification, AttributeTextFont, AttributeTextFontSize

Example

' Applies a color to the selected text
GraphicsBuilder.AttributeTextOnColourEx = &hFF0000

`Retrieves the current font color setting
MyVariable = GraphicsBuilder.AttributeTextOnColourEx

This function is implemented in the C++ environment as two separate functions: put_AttributeTextOnColourEx applies a color to the currently selected text, and get_AttributeTextOnColourEx retrieves the current text color.