我有责任在Powerpoint VBA中进行颜色填充。当我选择线条和方框时,我只想更改线条并让方框保持颜色。有没有办法只改变私人形状?
答案 0 :(得分:6)
以下代码会将幻灯片2中的所有线条颜色更改为Powerpoint 2007中的红色:
Public Sub ChangeLineColours()
Dim shp As Shape
For Each shp In ActivePresentation.Slides(2).Shapes '<~~ Change '2' to whichever slide you want to loop through
If shp.Type = msoLine Then
shp.Line.ForeColor.RGB = RGB(255, 0, 0)
End If
Next shp
End Sub