ThemeColorScheme.GetCustomColor method (Office)

Gets a value that represents a color in the color scheme of a Microsoft Office theme.

Syntax

expression.GetCustomColor(Name)

expression An expression that returns a ThemeColorScheme object.

Parameters

Name Required/Optional Data type Description
Name Required String The name of the custom color.

Return value

MsoThemeColorSchemeIndex

Remarks

If the named custom color doesn't exist, an error is generated.

Example

The following example creates a variable representing the color scheme in an Office theme, and then creates another variable containing a custom color. This custom color can then be combined with other colors to define the theme.

Dim tTheme As OfficeTheme 
Dim tcsThemeColorScheme As ThemeColorScheme 
Dim csCustomColor As MsoThemeColorSchemeIndex 
Set tcsThemeColorScheme = tTheme.ThemeColorScheme 
csCustomColor = tcsThemeColorScheme.GetCustomColor("CheerfulColor") 

See also

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.