Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / February 2008

Tip: Looking for answers? Try searching our database.

Copying NamedSlideShows

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CG - 31 Jan 2008 04:37 GMT
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?

Signature

CG

John Wilson - 31 Jan 2008 07:29 GMT
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

Signature

Amazing PPT Hints, Tips and Tutorials

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

> 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?
CG - 01 Feb 2008 18:50 GMT
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
Signature

CG

> You can find the names of custom shows like this
>
[quoted text clipped - 16 lines]
> > 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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.