Table of contents

ColorFormat 对象 (PowerPoint)ColorFormat Object (PowerPoint)

office 365 dev account|上次更新日期: 2018/3/13
2 参与人员

代表单色对象的颜色、 带有渐变或图案填充的对象的前景色或背景色,或者指针的颜色。可以设置颜色为明确的红-绿-蓝值 (通过使用RGB属性) 或配色方案中的颜色 (通过使用SchemeColor属性)。Represents the color of a one-color object, the foreground or background color of an object with a gradient or patterned fill, or the pointer color. You can set colors to an explicit red-green-blue value (by using the RGB property) or to a color in the color scheme (by using theSchemeColor property).


使用下表中列出的属性之一来返回一个ColorFormat对象。Use one of the properties listed in the following table to return a ColorFormat object.

使用此属性Use this property与此对象With this object返回一个 ColorFormat 对象,该对象表示此To return a ColorFormat object that represents this
DimColorDimColorAnimationSettingsAnimationSettings变暗对象使用的颜色Color used for dimmed objects
背景色BackColor二级FillFormat背景填充颜色(在底纹或带图案的填充中使用)Background fill color (used in a shaded or patterned fill)
前景色ForeColor二级FillFormat前景填充颜色(对于纯色填充,则代表填充颜色)Foreground fill color (the fill color for a solid fill)
对应颜色ColorFontFont项目符号或字符颜色Bullet or character color
背景色BackColorLineFormatLineFormat背景线条颜色(在带图案线条中使用)Background line color (used in a patterned line)
前景色ForeColorLineFormatLineFormat前景线条颜色(或只是实线的线条颜色)Foreground line color (or just the line color for a solid line)
前景色ForeColorShadowFormatShadowFormat阴影颜色Shadow color
PointerColorPointerColorSlideShowSettingsSlideShowSettings演示文稿的默认指针颜色Default pointer color for a presentation
PointerColorPointerColorSlideShowViewSlideShowView幻灯片放映视图中的临时指针颜色Temporary pointer color for a view of a slide show
ExtrusionColorExtrusionColorThreeDFormatThreeDFormat突出对象的边的颜色Color of the sides of an extruded object


使用SchemeColor属性以幻灯片元素的颜色设为标准配色方案中的颜色之一。下面的示例设置活动演示文稿第二为标准配色方案的标题颜色上第一个形状的文本颜色。Use the SchemeColor property to set the color of a slide element to one of the colors in the standard color scheme. The following example sets the text color for shape one on slide two in the active presentation to the standard color-scheme title color.

ActivePresentation.Slides(2).Shapes(1).TextFrame.TextRange.Font.Color.SchemeColor = ppTitle

使用RGB属性可将颜色设置为明确的红-绿-蓝值。下面的示例添加一个矩形myDocument,然后设置前景色、 背景色和矩形填充的渐变。Use the RGB property to set a color to an explicit red-green-blue value. The following example adds a rectangle to myDocument and then sets the foreground color, background color, and gradient for the rectangle's fill.

Set myDocument = ActivePresentation.Slides(1) 
With myDocument.Shapes.AddShape(msoShapeRectangle, 90, 90, 90, 50).Fill 
    .ForeColor.RGB = RGB(128, 0, 0) 
    .BackColor.RGB = RGB(170, 170, 170) 
    .TwoColorGradient msoGradientHorizontal, 1 
End With

另请参阅See also


PowerPoint 对象模型引用PowerPoint Object Model Reference

© 2018 Microsoft