Previous Document Next Document

Object Model Reference : Classes : P : Palette : Methods : Palette.FindColor


Palette.FindColor

Function FindColor(Name As String) As Long

Description

Member of Palette

The FindColor method finds a color by its name. If the name is found in the color palette, it returns the index number of the color in the palette; if the color is not found, it returns Nothing (0).

Parameter
Description
Name
Specifies the name to find

VBA example

The following VBA example searches the active palette for Red. If the color is not found, it is added to the palette.

Sub Test()
 If ActivePalette.FindColor("Red") = 0 Then
  ActivePalette.AddColor CreateRGBColor(255, 0, 0)
 End If
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.