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

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


expression.Colors(Index) expression.Colors(Index)

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


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

返回值Return value



在下面的示例中, 将msoThemeAccent1主题颜色设置为红色, 然后将方案保存到文件中。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

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.