View Single Post
 
Old 06-05-2018, 06:05 AM
Deniz Deniz is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Feb 2016
Posts: 3
Deniz is on a distinguished road
Default

Quote:
Originally Posted by JohnWilson View Post
For info this is crossposted on at least two other sites where there are answers
https://answers.microsoft.com/en-us/...c-c0a40721339f
http://www.vbaexpress.com/forum/show...m-one-PPT-file


Hello I found the answer. Following VBA code from John is giving me the right answer. For your information.



Sub splitFiles()
Dim tempR As Presentation
Dim opres As Presentation
Dim L As Long
Dim oFolder As String
'requires v. 2010 or later
On Error Resume Next
Set opres = ActivePresentation
Set tempR = Presentations.Add
tempR.PageSetup.SlideSize = opres.PageSetup.SlideSize
oFolder = Environ("USERPROFILE") & "\Desktop\Files\"
MkDir oFolder
For L = 1 To opres.Slides.Count
opres.Slides(L).Copy
tempR.Windows(1).Panes(1).Activate
Call CommandBars.ExecuteMso("PasteSourceFormatting")
Call tempR.SaveCopyAs(oFolder & "Slide" & CStr(L) & ".pptx", ppSaveAsOpenXMLPresentation)
tempR.Slides(1).Delete
Next L
tempR.Saved = True
tempR.Close
End Sub
Reply With Quote