PatternColorIndex 属性 (Word)Interior.PatternColorIndex property (Word)

返回或设置内部图案的颜色作为当前调色板中的索引, 或作为以下**XlColorIndex** 常量之一: xlColorIndexAutomaticxlColorIndexNoneReturns or sets the color of the interior pattern as an index into the current color palette, or as one of the following XlColorIndex constants: xlColorIndexAutomatic or xlColorIndexNone. 读/写 LongRead/write Long.



_表达式_一个代表 "内部" 对象的变量。expression A variable that represents an 'Interior' object.


将此属性设置为xlColorIndexAutomatic可指定图形对象的自动填充样式。Set this property to xlColorIndexAutomatic to specify the automatic fill style for drawing objects. 将该属性设置为 xlColorIndexNone,则表示您不希望使用图案(相当于将 Interior 对象的 Pattern 属性设置为 xlPatternNone)。Set this property to xlColorIndexNone to specify that you do not want a pattern (this is the same as setting the Pattern property of the Interior object to xlPatternNone).


以下示例为活动文档中第一个图表的第一个图表组启用涨/跌柱线,然后向跌柱线添加交叉图案并将图案颜色设置为红色。The following example enables up and down bars, then adds a criss-cross pattern to the down bars and sets the pattern color to red, for the first chart group of the first chart in the active document.

With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 With .Chart.ChartGroups(1) 
 .HasUpDownBars = True 
 .DownBars.Interior.Pattern = xlPatternCrissCross 
 .DownBars.Interior.PatternColorIndex = 3 
 End With 
 End If 
End With

另请参阅See also

Interior 对象Interior Object

支持和反馈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.