|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Const wdFormatText = 17 '2:text;8:html;9:rtf;10:htm
Set fsObject = CreateObject ("Scripting.FileSystemObject")
myPptDir=fsObject.GetAbsolutePathName("")
If Not (fsObject.FolderExists(myPptDir)) Then
MsgBox myPptDir & "源文件夹不存在,程序终止。", vbCritical, "错误"
Wscript.Quit
End If
If InStrRev(myPptDir, "\") < Len(myPptDir) Then
myPptDir = myPptDir & "\"
End If
Set PptFilesDir = fsObject.Getfolder(myPptDir)
Set myPptFiles = PptFilesDir.Files
Set myObject = Wscript.CreateObject("Powerpoint.Application")
For Each PptFile In myPptFiles
If LCase(Right(PptFile.Name, 3)) = "ppt" Then
JPGFileName = myPptDir & Left(PptFile.Name,InStrRev (PptFile.Name, ".")) & "jpg"
Set Pres = myObject.Presentations.Open(pptFile.Path, False, False, False)'Open(FileName,ReadOnly,Untitled,WithWindow)
Pres.SaveAs JPGFileName, 17, False
End If
Next
MsgBox "Done!"
myObject.Quit
Set myObject = Nothing
以上代码可以将扩展名ppt的ppt批量转成jpg ,怎么修改代码支持pptx格式,谢谢
|
|