ColorScheme.Colors property (Publisher)

Returns a ColorFormat object representing a color from the specified color scheme.

Syntax

expression.Colors (ColorIndex)

expression A variable that represents a ColorScheme object.

Parameters

Name Required/Optional Data type Description
ColorIndex Required PbSchemeColorIndex The color from the scheme to return based on its function in the scheme. Can be one of the PbSchemeColorIndex constants declared in the Microsoft Publisher type library.

Return value

ColorFormat

Example

The following example loops through the ColorSchemes collection and looks for color schemes where the followed hyperlink color matches the color with the RGB value of 128.

Dim cscLoop As ColorScheme 
Dim colTemp As ColorFormat 
 
For Each cscLoop In Application.ColorSchemes 
 With cscLoop 
 Set colTemp = .Colors(ColorIndex:=pbSchemeColorFollowedHyperlink) 
 If colTemp.RGB = RGB(128, 0, 0) Then 
 Debug.Print "Color scheme '" & .Name _ 
 & "' has a followed hyperlink " _ 
 & "color matching RGB(128, 0, 0)" 
 End If 
 End With 
Next cscLoop

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.