我测试过的脚本是从 excel 应用程序运行的,它将计算图片的形状和实际形状的数量(即文本框、占位符)。下面是弹出带有图片和形状数量的消息的脚本
Sub countshapes()
Dim strname As String
Dim thisslide As Long
Dim strshape() As String
-----Count the number of slides in presentation
For thisslide = 1 To ActivePresentation.Slides.count
With ActivePresentation.Slides(thisslide)
ReDim strshape(0 To 0)
For Each oshp In .Shapes
If InStr(1, oshp.Name, "Picture") > 0 Then
ReDim Preserve strshape(0 To a)
strshape(a) = oshp.Name
a = a + 1
Else
ReDim Preserve strshape(0 To d)
strshape(d) = oshp.Name
d = d + 1
End If
Next oshp
End With
Next
MsgBox a
MsgBox d
形状和图片的数量完美显示但是我无法获得形状组的数量,这可以通过 .type=msogroup 属性轻松实现,但是该属性在某些具有许多分组形状的演示文稿中对我没有帮助。
请帮助我通过使用形状的名称来更新脚本,就像上面的脚本一样