Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB 6.0n Running Power point presentation

Status
Not open for further replies.

Chavito21

Programmer
Mar 26, 2003
230
US
Does anyoone know how to run a Power point presentation and when is done close PowerPoint.
I have this code:

Private Sub Command1_Click()

Dim ppt As Object
Dim pptFile As String
Dim reply, promt
promt = "PRESS SPACEBAR TO MOVE FROM SLIDE TO SLIDE" & _
" IN THE PRESENTATION." & vbCrLf & " " & vbCrLf & "READY TO START?"
reply = MsgBox(promt, vbYesNo, "Amazing Powerpoint")
If reply = vbYes Then
Set ppt = CreateObject("PowerPoint.Application")
ppt.Visible = True
pptFile = App.Path & "\Thermal.ppt"
ppt.presentations.Open pptFile
'ppt.ActivePresentation.SlideShowSettings.Run
With ppt.ActivePresentation.SlideShowSettings
'.StartingSlide = 1
'.EndingSlide = 4
'For I = .StaringSlide to .endingSlide
'.RangeType = ppShowSlideRange
'.AdvanceMode = ppSlideShowUseSlideTimings
'.Run
'.LoopUntilStopped = True
Do
.Run
Loop While .LoopUntilStopped = True
'ppt.Quit
End

End With
'If ppt.ActivePresentation.LoopUntilStopped = True Then
'ppt.Quit
'End If
'Set ppt = Nothing

End If

End Sub

As you can see I been comments some lines trying to make this work if someone have some ideas let me know.

Thanks
 
Chavito21

Have you considered using Slide Transition?

Then in your class module add:
Dim WithEvents appPPT As PowerPoint.Presentation
Dim SlideShowEnd As SlideShowSettings

Private Sub App_SlideShowEnd(ByVal Pres As Presentation)
With Pres.Slides.Range(Array(1, ?)) _ 'replace ? with number of slides
.AdvanceOnTime = msoTrue
End With

With Pres.SlideShowSettings
.AdvanceMode = ppSlideShowUseSlideTimings
.AdvanceMode = (1)
End With
End Sub

boat =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top