Powerpoint Alchemy Amazing techniques and tips
Amazing techniques which will transform your use of PowerPoint presentations. Make your presentation stand out from the crowd!

About

Use vba to Split a Presentation into Single Slide Presentations

If you haven't already read How to Use vba Code you should do this first.

Sometimes, maybe for cataloguing you want to split presentations into a set of single slide presentations. There are several manual ways eg cut and paste into a new presentation or use Insert Slides from File to create new presentations. All of these will be extremely time consuming.

This vba does it in one go:

(As always use a copy of your presentation)

Sub singles()
Dim i As Integer
Dim osource As Presentation
Dim otarget As Presentation
'SAVE A COPY
ActivePresentation.SaveCopyAs (Environ("TEMP") & "\tempfile.ppt")
Set osource = Presentations.Open(Environ("TEMP") & "\tempfile.ppt")
For i = osource.Slides.Count To 1 Step -1
osource.Slides(i).Copy
Set otarget = Presentations.Add(msoTrue)
otarget.Slides.Paste
'FOLLOW DESIGN
otarget.Slides(1).Design = osource.Slides(i).Design
otarget.Slides(1).ColorScheme = osource.Slides(i).ColorScheme
osource.Slides(i).Delete
'SAVE THE ONE SLIDE PRES
otarget.SaveAs (Environ("USERPROFILE") & "\Desktop\Slide " & CStr(i)) & ".ppt"
otarget.Close
Set otarget = Nothing
Next i
osource.Close
'REMOVE THE TEMP FILE

kill (Environ("TEMP") & "\tempfile.ppt")
Set osource = Nothing
End Sub

IF YOU HAVE v.2007 you should change all the '.ppt' to '.pptx'

The use of Environ for environmental variables can be extremely useful:

environ("TEMP") is the current user's local temp folder

environ ("USERPROFILE") is equivalent to C:\Documents and Settings\username or in Vista C:\Users\username

Note that if you cut or delete slides you must step BACKWARDS through the slides otherwise when you delete slide 3, slide 4 becomes the new slide 3!!



 


This website is sponsored by Technology Trish Ltd
© Technology Trish 2007
Registered in England and Wales No.5780175