Public Sub StartRecursionFolder()
Dim Pre As Presentation
Dim FolderPath As String
Dim pp As String
Dim id As String
Dim oFileDialog As FileDialog
Set oFileDialog = Application.FileDialog(msoFileDialogFolderPicker)
Set Pre = Application.ActivePresentation
With oFileDialog
.AllowMultiSelect = False
'.InitialFileName = Pre.Path & "\"
If .Show = 0 Then Exit Sub
End With
FolderPath = oFileDialog.SelectedItems(1) & "\"
'递归处理
RecursionFolder FolderPath
MsgBox "批处理完成"
End Sub
Public Sub PresentationHandle(ByVal FilePath As String)
Application.DisplayAlerts = ppAlertsNone
Dim Pre As Presentation
Dim mst As Master
Dim Shp As Shape
Debug.Print FilePath
Set Pre = Application.Presentations.Open(FilePath)
'******************************母版的处理**********************
Set mst = Pre.SlideMaster
For Each Shp In mst.Shapes
'删除条件
If BetweenSize(Shp.Width, 145, 160) And BetweenSize(Shp.Height, 30, 55) Then
Shp.Delete
End If
Next Shp Pre.Save
Pre.Close Set Pre = Nothing
Set mst = Nothing
Set sld = Nothing Application.DisplayAlerts = ppAlertsAll
End Sub
Private Function BetweenSize(ByVal Size As Double, ByVal MinSize As Double, ByVal MaxSize As Double) As Boolean
If Size > MinSize And Size < MaxSize Then
BetweenSize = True
Else
BetweenSize = False
End If
End Function
Public Sub RecursionFolder(ByVal FolderPath As String) '递归文件夹
'声明对象
Dim Fso As Object
Dim MainFolder As Object
Dim OneFolder As Object
Dim OneFile As Object
'实例化对象
Set Fso = CreateObject("Scripting.FileSystemObject")
Set MainFolder = Fso.GetFolder(FolderPath)
'对文件执行操作
For Each OneFile In MainFolder.Files
If OneFile.Name Like "*.ppt*" Then
'具体要做的事情
PresentationHandle OneFile.Path
End If
Next
'递归
For Each OneFolder In MainFolder.SubFolders
RecursionFolder OneFolder.Path
Next
'释放对象
Set Fso = Nothing
Set MainFolder = Nothing
End Sub

  

最新文章

  1. java package一些试验
  2. 9.5.8 Optimizing InnoDB Disk I/O
  3. mac安装cocoapods
  4. .NET framework 4.0安装失败怎么办
  5. django最简单表单入门
  6. 为代码减负之&amp;lt;二&amp;gt;存储过程(SQL)
  7. Kotlin——最详细的环境搭建
  8. php-自动过滤、自动填充、自动验证
  9. apache服务器绑定泛解析域名
  10. 输入一个字母,是元音字母,则输出时元音字母*,否则,输出为辅音字母 (元音字母有:a,e,i,o,u)
  11. 利用gitbush从git上下载代码到本地
  12. 服务管理之samba
  13. python之socket模块详解--小白博客
  14. react-native布局篇
  15. java 偏向锁,轻量锁,重量级锁
  16. 解决 iframe 后退不是主页面后退(浏览器 history)问题
  17. org.apache.cxf 官方骨架
  18. js简单时间比较的方法(转)
  19. Selenium Webdriver——使用reportng
  20. Java多线程学习(一)

热门文章

  1. RocketMQ 2主2从 集群搭建
  2. Python3 爬取微信好友基本信息,并进行数据清洗
  3. Jsoup解析网页html
  4. GitHub Desktop离线安装包
  5. tf.placeholder使用说明
  6. 使用Oracle执行计划分析SQL性能
  7. Python3基础 str casefold 返回全是小写字母的新字符串
  8. 浅入浅出JS中的eval及json
  9. 垒骰子|2015年蓝桥杯B组题解析第九题-fishers
  10. 三羊献瑞|2015年蓝桥杯B组题解析第三题-fishers