Skip to content
本页内容

Solid (方法)

将指定填充设为统一的颜色。使用此方法可将渐变、纹理、图案或背景填充转换为纯色填充。

示例

python
#此示例将第一张工作表中的所有填充转换为统一的红色填充
def test():
    shapes = Application.Worksheets.Item(1).Shapes
    for i in range(1, shapes.Count):
        fill = shapes.Item(i).Fill
        fill.Solid()
        fill.ForeColor.RGB = RGB(255, 0, 0)
python
#本示例将活动工作表中第二个形状的填充格式设置为纯色填充
def test():
    fillFormat = ActiveSheet.Shapes.Item(2).Fill
    fillFormat.Solid()