Copying NamedSlideShows

  • Thread starter Thread starter CG
  • Start date Start date
C

CG

I have a macro that copies all the slides however I can not figure out how to
copy all the NamedSlideShows. Do you have to copy the brute force? Build an
array of the slides etc? I believe I will need some help at some point. Is
there a reference of all the properties I would need to copy?
 
You can find the names of custom shows like this

Sub names()
Dim NSS As NamedSlideShow
For Each NSS In ActivePresentation.SlideShowSettings.NamedSlideShows
MsgBox NSS.Name
Next
End Sub

Once you have the name you can buils an array of the slide ID's using the
SlideIDs
property

idArray = ActivePresentation.SlideShowSettings _
.NamedSlideShows("My Show").SlideIDs


--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
John,

Thanks!

Here is my final code that works. I had problems with the arrayIds. If the
slides were moved from the original insertion order the slide show had the
wrong slides. It would use the slideindex order instead of the slideid order.

Any thoughts or improvements from anyone would be appreciated.

CG

Sub CopySlidesAndSlideShows()

Dim orgPres As Presentation
Dim newPres As Presentation
Dim arrayid As Variant
Dim newarrayid As Variant
Set orgPres = ActivePresentation
Set newPres = Presentations.Add '("C:\Presentation.ppt")
Dim cc As Variant

For Each s In orgPres.Slides
s.Copy
newPres.Slides.Paste
Next
For Each ss In orgPres.SlideShowSettings.NamedSlideShows

arrayid = ss.SlideIDs
ReDim newarrayid(1 To UBound(arrayid))

For i = 1 To UBound(arrayid)
newarrayid(i) =
orgPres.Slides.FindBySlideID(arrayid(i)).SlideIndex
newarrayid(i) = newPres.Slides(newarrayid(i)).SlideID
Next i

newPres.SlideShowSettings.NamedSlideShows.Add ss.Name, arrayid

Next
End Sub
 
Back
Top