Prev: Linking to a web database
Next: pptx to pps
From: David M. Levine on 19 Jan 2010 16:14 I want to play several slide shows, depending on selections on a VBA form. I was hoping that it would be a snap, but 2002 does not seem to share my enthusiasm. I am looking to do something such as: Application.ActivePresentation.SlideShowWindow.View.GotoNamedShow "Custom Show 1" Application.ActivePresentation.SlideShowWindow.View.GotoNamedShow "Custom Show 3" Application.ActivePresentation.SlideShowWindow.View.GotoNamedShow "Custom Show 8" Other ways to concactinate a new show selected in real time would also work. Thanks, David
From: Steve Rindsberg on 19 Jan 2010 23:10 In article <5DD1B844-3382-4F77-846D-32A4316F0250(a)microsoft.com>, David M. Levine wrote: > I want to play several slide shows, depending on selections on a VBA form. I > was hoping that it would be a snap, but 2002 does not seem to share my > enthusiasm. > > I am looking to do something such as: > > Application.ActivePresentation.SlideShowWindow.View.GotoNamedShow "Custom > Show 1" > Application.ActivePresentation.SlideShowWindow.View.GotoNamedShow "Custom > Show 3" > Application.ActivePresentation.SlideShowWindow.View.GotoNamedShow "Custom > Show 8" > > Other ways to concactinate a new show selected in real time would also work. I like your idea of concatenating the shows temporarily into another custom show. Here you go, hot off the fingers: Option Explicit Sub SpecifyShows() ' Creates an array and fills it with the names of the custom ' shows to be concatenated ' Calls CONCATSHOWS to combine the contents of the shows in the array ' Calls RUNSHOW to run the show Dim aShowNames(1 To 2) As String ' Replace this with whatever code is appropriate ' to fill the array with the number of ' shows you want to use aShowNames(1) = "TEST_2" aShowNames(2) = "TEST_1" ' Concatenate the shows ConcatShows aShowNames ' Run the concatenated show RunShow "TEMPSHOW" ' delete the show ActivePresentation.SlideShowSettings.NamedSlideShows("TEMPSHOW").Delete End Sub Sub ConcatShows(aShowNames As Variant) Dim lShowCount As Long Dim x As Long Dim aSlideIds() As Long ReDim aSlideIds(1 To 1) As Long With ActivePresentation.SlideShowSettings With .NamedSlideShows ' look at each showname passed in the aShowNames array For lShowCount = 1 To UBound(aShowNames) Debug.Print aShowNames(lShowCount) ' get the array of slides in the show For x = 1 To .Item(aShowNames(lShowCount)).Count ' add each slide id to the aSlideIds array Debug.Print .Item(aShowNames(lShowCount)).SlideIDs(x) aSlideIds(UBound(aSlideIds)) = .Item(aShowNames (lShowCount)).SlideIDs(x) ' add another element to the array ReDim Preserve aSlideIds(1 To UBound(aSlideIds) + 1) Next Next ' delete the last blank element from the array ReDim Preserve aSlideIds(1 To UBound(aSlideIds) - 1) .Add "TEMPSHOW", aSlideIds End With ' NamedSlideShows End With ' SlideShowSettings End Sub Sub RunShow(sShowName As String) ' This simply runs the specified show ' with the settings you want to use With ActivePresentation.SlideShowSettings ' change these as needed .ShowType = ppShowTypeSpeaker '.LoopUntilStopped = msoTrue .ShowWithNarration = msoTrue .ShowWithAnimation = msoTrue .RangeType = ppShowNamedSlideShow .SlideShowName = sShowName .Run End With End Sub ============================== PPT Frequently Asked Questions http://www.pptfaq.com/ PPTools add-ins for PowerPoint http://www.pptools.com/
From: phatboyslim on 27 Jan 2010 11:24 Can a button be used in an show that is already running to activate the custom slideshow? --- frmsrcurl: http://msgroups.net/microsoft.public.powerpoint/Playing-multiple-Custom-slide-shows-through-VBA
|
Pages: 1 Prev: Linking to a web database Next: pptx to pps |