S
SV
I tried to modify http://www.pptfaq.com/FAQ00740.htm to save as
PowerPoint2007
Looking at http://www.eggheadcafe.com/software/aspnet/34812242/vbasaveas.aspx
suggests that I should use ppSaveAsOpenXMLPresentation as the
ppSaveAsFileType
The resulting code (below) works but the file extension is still .ppt
and not .pptx
The file size is reduced so something is happening!
Is there something missing??
Steve
Sub BatchSave()
' Opens each PPT in the target folder and saves as PPT2007 format
Dim sFolder As String
Dim sPresentationName As String
Dim oPresentation As Presentation
' Get the foldername:
sFolder = "c:\Users\Me\My Documents\TestExtract\" ' Note: MUST
end in \
If sFolder = "" Then
Exit Sub
End If
' Make sure the folder name has a trailing backslash
If Right$(sFolder, 1) <> "\" Then
sFolder = sFolder & "\"
End If
' Are there PPT files there?
If Len(Dir$(sFolder & "*.PPT")) = 0 Then
MsgBox "Bad folder name or no PPT files in folder."
Exit Sub
End If
' Open and save the presentations
sPresentationName = Dir$(sFolder & "*.PPT")
While sPresentationName <> ""
Set oPresentation = Presentations.Open(sFolder &
sPresentationName, , , False)
Call oPresentation.SaveAs(sFolder & "N_" & sPresentationName,
ppSaveAsOpenXMLPresentation, msoFalse)
oPresentation.Close
sPresentationName = Dir$()
Wend
MsgBox "DONE"
End Sub
PowerPoint2007
Looking at http://www.eggheadcafe.com/software/aspnet/34812242/vbasaveas.aspx
suggests that I should use ppSaveAsOpenXMLPresentation as the
ppSaveAsFileType
The resulting code (below) works but the file extension is still .ppt
and not .pptx
The file size is reduced so something is happening!
Is there something missing??
Steve
Sub BatchSave()
' Opens each PPT in the target folder and saves as PPT2007 format
Dim sFolder As String
Dim sPresentationName As String
Dim oPresentation As Presentation
' Get the foldername:
sFolder = "c:\Users\Me\My Documents\TestExtract\" ' Note: MUST
end in \
If sFolder = "" Then
Exit Sub
End If
' Make sure the folder name has a trailing backslash
If Right$(sFolder, 1) <> "\" Then
sFolder = sFolder & "\"
End If
' Are there PPT files there?
If Len(Dir$(sFolder & "*.PPT")) = 0 Then
MsgBox "Bad folder name or no PPT files in folder."
Exit Sub
End If
' Open and save the presentations
sPresentationName = Dir$(sFolder & "*.PPT")
While sPresentationName <> ""
Set oPresentation = Presentations.Open(sFolder &
sPresentationName, , , False)
Call oPresentation.SaveAs(sFolder & "N_" & sPresentationName,
ppSaveAsOpenXMLPresentation, msoFalse)
oPresentation.Close
sPresentationName = Dir$()
Wend
MsgBox "DONE"
End Sub