|
It is known the the Export method can be
used to export slides as graphics. However it is little known that the
Export method can also be used to export a slide as a presentation. Given
below is the code to export
each slide as a separate
presentation. Add/Modify stuff as required. Be sure to add some
error handling.
You might notice the code block A and may
be interested to understand it's relevance within the export routine.
When the slide is exported as a presentation, PowerPoint by default
embeds the true type fonts used in that slide. This will cause an
increase in file size as much as 12 MB for a single presentation if
Unicode fonts are present. Hence in Block A I reopen the export file and
save it again with the embed font property set to FALSE. It may be
removed if you want to retain the embedded font state.
Note: If the slide has Unicode fonts, it
could take a while in exporting the slide. It would be prudent to warn
the user of the delay before exporting the slide.

'
--------------------------------------------------------------------------------
' Copyright ©1999-2007, Shyam Pillai, All Rights Reserved.
'
--------------------------------------------------------------------------------
' You are free to use this code within your own applications, add-ins,
' documents etc but you are expressly forbidden from selling or
' otherwise distributing this source code without prior consent.
' This includes both posting free demo projects made from this
' code as well as reproducing the code in text or html format.
'
--------------------------------------------------------------------------------
Option Explicit
Sub ExportSlidesAsPresentations()
Dim oPres As Presentation
Dim oExportedPres As Presentation
Dim oSld As Slide
Dim sSlideOutputFolder As String
Dim sFilename As String
sSlideOutputFolder = "D:\Temp\"
Set oPres = ActivePresentation
For Each oSld In oPres.Slides
sFilename = (sSlideOutputFolder) & "Slide" & _
Format(oSld.SlideIndex, "000") & ".ppt"
oSld.Export sFilename, "PPT"
'----- Block A -----
Set oExportedPres = Presentations.Open(sFilename, _
False, False, False)
Call oExportedPres.SaveAs(sFilename, _
ppSaveAsPresentation, False)
oExportedPres.Close
Set oExportedPres = Nothing
'----- End of Block A -----
Next oSld
Set oPres = Nothing
End Sub

|