ThemeColorScheme.Colors 方法 (Office)ThemeColorScheme.Colors method (Office)

获取一个代表 Microsoft Office 主题的配色方案中颜色的对象。Gets an object that represents a color in the color scheme of a Microsoft Office theme.

语法Syntax

expressionexpression. Colors( _Index_ )

_表达式_一个返回ThemeColorScheme对象的表达式。expression An expression that returns a ThemeColorScheme object.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
IndexIndex 必需Required MsoThemeColorSchemeIndexMsoThemeColorSchemeIndex ThemeColor对象的索引值。The index value of the ThemeColor object.

返回值Return value

ThemeColorThemeColor

示例Example

在以下示例中,将msoThemeAccent1主题颜色设置为颜色Red ,然后将方案保存到文件。In the following example, the msoThemeAccent1 theme color is set to the color Red and then the scheme is saved to a file.

Dim tTheme As OfficeTheme 
Dim tcsThemeColorScheme As ThemeColorScheme 
Dim tcThemeColor As ThemeColor 
tcThemeColor.RGB = RGB(255, 0, 0) 
Set tcColorScheme.Colors(msoThemeAccent1) = tcThemeColor 
tcsThemeColorScheme.Save ("C:\myThemeColorScheme.xml") 

另请参阅See also

ThemeColorScheme 对象ThemeColorScheme Object

ThemeColorScheme 对象成员ThemeColorScheme Object Members