标题: 【源码】ACCESS VBA遍历PPT中所有shape(形状)属性的常用方法 [打印本页] 作者: tmtony 时间: 2015-7-11 08:35 标题: 【源码】ACCESS VBA遍历PPT中所有shape(形状)属性的常用方法 ACCESS VBA遍历PPT中所有shape(形状)属性的常用方法Dim intCnt As Integer
Dim strTmp as String
Set pptApp = CreateObject("Powerpoint.application")
pptApp.Visible = True
For i = 1 To iFileCnt
Set ppt = pptApp.Presentations.Open(arrAllFiles(i))
For Each mySlide In ppt.Slides
If mySlide.SlideIndex > 2 Then
For Each myShape In mySlide.Shapes
If myShape.Type = 1 Then
strTmp = ""
strTmp = myShape.TextFrame.TextRange.Text
If strTmp <> "" And Left(tmpString, 1) = "你指定的内容" Then
intCnt = intCnt + 1 '计数器+1
Debug.Print strTmp
End If
End If
Next
End If
Next
'释放PPT对象
ppt.Close
Set ppt = Nothing
Next
pptApp.Quit
Set pptApp = Nothing