Hi John
I have this code, which works great, selected slides are added to a new file ready to save.
Is there a way for it to save the slides to a specific folder, i.e. C:\MyFolder and name the file with the same filename maybe? This doesn't affect the folder slides are taken from, that just stays open.
Thank you
Sub SaveToFolder() Dim NewPPT As Presentation Dim OldPPT As Presentation Dim Selected_slds As SlideRange Dim Old_sld As Slide Dim New_sld As Slide Dim Swap As Variant Dim x As Long, y As Long Dim myArray() As Long Dim SortTest As Boolean Set OldPPT = ActivePresentation Set Selected_slds = ActiveWindow.Selection.SlideRange ReDim myArray(1 To Selected_slds.Count) For y = LBound(myArray) To UBound(myArray) myArray(y) = Selected_slds(y).SlideIndex Next y Do SortTest = False For y = LBound(myArray) To UBound(myArray) - 1 If myArray(y) > myArray(y + 1) Then Swap = myArray(y) myArray(y) = myArray(y + 1) myArray(y + 1) = Swap SortTest = True End If Next y Loop Until Not SortTest 'Set variable equal to only selected slides in Active Presentation (in numerical order) Set Selected_slds = OldPPT.Slides.Range(myArray) 'Create a brand new PowerPoint presentation Set NewPPT = Presentations.Add 'Align Page Setup NewPPT.PageSetup.SlideHeight = OldPPT.PageSetup.SlideHeight NewPPT.PageSetup.SlideOrientation = OldPPT.PageSetup.SlideOrientation NewPPT.PageSetup.SlideSize = OldPPT.PageSetup.SlideSize NewPPT.PageSetup.SlideWidth = OldPPT.PageSetup.SlideWidth 'Loop through slides in SlideRange For x = 1 To Selected_slds.Count 'Set variable to a specific slide Set Old_sld = Selected_slds(x) 'Copy Old Slide y = Old_sld.SlideIndex Old_sld.Copy 'Paste Slide in new PowerPoint NewPPT.Slides.Paste Set New_sld = Application.ActiveWindow.View.Slide 'Bring over slides design New_sld.Design = Old_sld.Design 'Bring over slides custom color formatting New_sld.ColorScheme = Old_sld.ColorScheme 'Bring over whether or not slide follows Master Slide Layout (True/False) New_sld.FollowMasterBackground = Old_sld.FollowMasterBackground Next x End Sub






Reply With Quote
