ChartColorFormat.RGB 屬性 (Word)ChartColorFormat.RGB property (Word)

會傳回指定之色彩的紅-綠-藍 (RGB) 值。Returns the red-green-blue value of the specified color. 唯讀的 LongRead-only Long.

語法Syntax

expressionexpression. RGB

_運算式_代表 'ChartColorFormat' 物件的變數。expression A variable that represents a 'ChartColorFormat' object.

範例Example

下列範例會啟用上漲線及下跌線,然後針對使用中文件內第一張圖表的第一個圖表群組,新增下跌線的交叉十字型圖樣,並將圖樣色彩設定為圖表區前景填滿色彩。The following example enables up and down bars, then adds a criss-cross pattern to the down bars and sets the pattern color to the chart area foreground fill color, 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 
 .ChartGroups(1).DownBars.Interior.Pattern = xlPatternCrissCross 
 .ChartGroups(1).DownBars.Interior.PatternColor = _ 
 .ChartArea.Fill.ForeColor.RGB 
 End With 
 End If 
End With

請參閱See also

ChartColorFormat 物件ChartColorFormat 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.