在ppt中,一切皆图形。
有时候我们需要批量删除指定形状的图形,可以使用如下的vba代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
Sub QQ1722187970() Dim oPPT As Presentation Dim oSlide As Slide Dim oCL As CustomLayout Dim oP As Shape '当前ppt演示文稿 Set oPPT = PowerPoint.ActivePresentation With oPPT '遍历每一个幻灯片 For Each oSlide In .Slides With oSlide '遍历每一个图形 For Each oP In .Shapes With oP sName = .Name iType = .Type '批量删除所有椭圆形 If sName Like "*椭圆*" Then .Delete End If End With Next End With Next End With End Sub |
[……]
阅读全文>>>