ppt批量jpg,求大神修改一下代码
Const wdFormatText = 17 '2:text;8:html;9:rtf;10:htmSet 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格式,谢谢
页:
[1]