Python Code:
from win32com.client import GetObject
msoChart = 3
msoTrue = -1
objApp = GetObject(Class = "PowerPoint.Application")
objPre = objApp.ActivePresentation
objSld = objPre.Slides(1)
if objSld.Shapes(1).Type == msoChart:
# 图表区
objChart = objSld.Shapes(1).Chart
objChart.ChartArea.Format.Fill.ForeColor.RGB = 0xFFFF8F0
# 边框
objLFmt = objChart.Format.Line
objLFmt.Visible = msoTrue
objLFmt.ForeColor.RGB = 0x50B000
objLFmt.Weight = 3
运行前:
运行后: