Boo*_*d16 6 charts powerpoint vba loops
我是PowerPoint VBA的新手,请耐心等待.
我想要:
到目前为止,我已经能够完成前3个任务,但我需要最后2个帮助.这是我的代码:
Sub test()
Dim slide As Object
Dim shape As Object
Dim shapeNames As Object
Dim chSeries As Series
i = 0
For Each slide In ActivePresentation.Slides
For Each shape In slide.Shapes
If shape.HasChart Then
i = i + 1
Debug.Print "found a chart on slide", i
End If
Next
Next
End Sub
Run Code Online (Sandbox Code Playgroud)
Boo*_*d16 11
解决了.
Sub test()
Dim sld As Slide
Dim shp As Shape
Dim sr As Series
Dim chrt As Chart
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.HasChart Then
Debug.Print shp.Chart.ChartType
If shp.Chart.ChartType = 57 Then
shp.Chart.SeriesCollection(1).DataLabels.Font.Color = RGB(0, 0, 0)
End If
End If
Next shp
Next sld
End Sub
Run Code Online (Sandbox Code Playgroud)
虽然我没有成功循环图表中的系列,但这是有效的.