PDA

View Full Version : Another Powerpoint Question



Saxylady1964
03-10-2009, 09:45 AM
I found the following code and it is meeting my needs...well almost. The code is opening and running a powerpoint presentation and then closing powerpoint when the presentation is finished. What I would like to be able to do is to run a "Custom Show" instead of the full presentation. Is this possible? : pray2:

Dim MyPath As String
MyPath = ThisDocument.Path

Dim PPT As Object
Set PPT = CreateObject("Powerpoint.Application")
Application.ScreenUpdating = False
With PPT
.Visible = True
.Presentations.Open FileName:=MyPath & Application.PathSeparator & "Parks NYRW 090210-pruf.ppt"
DoEvents
With .ActivePresentation.SlideShowSettings
.LoopUntilStopped = True
With .Run
On Error Resume Next
Do Until .View.State = ppSlideShowDone
If Err <> 0 Then Exit Do
Loop
On Error GoTo 0
End With
End With
End With
PPT.Quit
Set PPT = Nothing

Thanks In Advance

Saxylady1964
03-10-2009, 10:03 AM
I found my answer myself :)

I added the following 2 lines after the With.ActivePresentation.SlideShowSettings

.RangeType = ppShowNamedSlideShow
.SlideShowName = "2"