[vba]获取PPT幻灯片中的所有标题
2010-08-20 12:43
169 查看
Private Sub CommandButton1_Click() Me.Enabled = False getTitles Me.Enabled = True End Sub Sub getTitles() On Error Resume Next Dim oPres As Presentation Set oPres = Application.ActivePresentation Dim oSlide As Slide Dim oShape As Shape Dim tr As TextRange Dim sText As String Dim i As Long, j As Long '循环每页幻灯 For i = 1 To oPres.Slides.Count Set oSlide = oPres.Slides.Item(i) '获取图形对象 For j = 1 To oSlide.Shapes.Count Set oShape = oSlide.Shapes.Item(j) '如果有文字 If oShape.TextFrame.HasText = msoTrue Then Set tr = oShape.TextFrame.TextRange sText = tr.Text '如果符合格式: 根据情况设定, 此处前三位构成为x.y If IsNumeric(Left(sText, 3)) Then 'MsgBox sText TextBox1.SelStart = 65535 TextBox1.SelText = sText & vbCrLf End If Set tr = Nothing End If Set oShape = Nothing Next Set oSlide = Nothing Next Set oPres = Nothing End Sub
相关文章推荐
- 【原创】获取网页中所有密码和发帖标题内容
- 获取已打开的所有记事本的标题
- vba 宏获取文件夹中所有excel文件,对slk文件数据每3000个求平均值
- 获取一个按钮数组内的所有按钮的标题
- 获取所有打开的窗口的标题
- VBA获取某文件夹下所有文件和子文件目录的文件
- 使用HtmlUnit获取博客园第一页的所有文章标题
- 使用 Aspose.Slide 获取PPT中的所有幻灯片的标题
- C# 如何获取PPT演示文档中的所有标题
- 获取已打开的所有记事本的标题
- VBA 获取窗口标题 - 在PPT放映窗口与其他窗口间切换
- 获取所有顶层窗口的句柄,类名及标题数组
- C#获取文件夹下的所有文件的文件名
- js树插件zTree获取所有选中节点数据的方法
- 获取本机的所有IP,子网掩码(subnet mask)和默认网关
- 获取listview的所有子目录高度(使用item较少情况)
- C#控制台基础 assembly与fullname获取一个dll中所有的命名空间
- Java 获取指定数据库指定用户名的所有表名称
- 从一个网页中获取所有的超链接