设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 4778|回复: 1
打印 上一主题 下一主题

[与其它组件] 【源码】ACCESS VBA遍历PPT中所有shape(形状)属性的常用方法

[复制链接]

点击这里给我发消息

跳转到指定楼层
1#
发表于 2015-7-11 08:35:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2015-7-12 12:02:42 | 只看该作者

谢谢楼主
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-4-27 18:11 , Processed in 0.075114 second(s), 25 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表