PDA

View Full Version : Opening PPS files



Broodmdh
04-21-2010, 07:14 AM
We want to use buttons to launch various PPS files. I've tried code that I found on this site, but it isn't working. We also want to be able to reuse the Sub for each button, despite each button "pointing" to different PPS files. Is that possible? Where would you store the path? We also want the ability to indicate which slide the PPS should jump to on opening. I'm storing that info on the button itself right now, but that's a bad solution. All suggestions are welcome.


Dim sParameters As String
Dim vParameters As Variant
Dim iNumParameters As Integer

sParameters = oShape.TextFrame.TextRange.Text
vParameters = Split(sParameters, ",")

If Not IsNumeric(vParameters(0)) Then 'PPS Path
Dim pShow As Presentation
Dim ppsFile As Object
Set ppsFile = CreateObject("Powerpoint.Application")
Set pShow = ppsFile.Presentations.Open(vParameters(0))

If Not vParameters(1) Is Nothing Then ' Slide Number also provided
pShow.SlideShowWindow.View.GotoSlide (vParameters(1))
End If
Else 'Slide Number
ActivePresentation.SlideShowWindow.View.GotoSlide (vParameters(0))
End If