Want to check if PowerPoint presentation show has completed in VB
Hi All
Have not posted anything for ages, anyhow I have a program which chooses a powerpoint show and then runs it the code for running the show is:
Code:
Imports Microsoft.Office.Interop.PowerPoint
Private Sub show_pp()
Appt = New Application
Appt.Activate()
Pppt = Appt.Presentations.Open(myPath & pp)
Pppt.SlideShowSettings.Run()
If instance = PpSlideShowState.ppSlideShowDone Then
Me.BringToFront()
End If
End Sub
When I the show runs the VB form is sent to the back otherwise it stays on top of the PP, the problem is that I am unable to detect when the PP is completed and the form does not come to the front of the screen but stays in the task bar.
I have tried by using the 'instance' in the code but this does not do anything. I have looked at many posts in the forum about background worker, but I am at a loss as to what to do.:confused:
Your help would be appreciated
Badgersoft333
Re: Want to check if PowerPoint presentation show has completed in VB
Quote:
I have tried by using the 'instance' in the code but this does not do anything.
Why would it? The code is executed immediately after the presentation starts and then never again. If the program was going to conveniently wait around at this point for the presentation to finish then this code wouldn't even be necessary. Monitoring anything requires either an event triggered by the monitee (is that even a word?) or regular polling via a timer. As I'm not aware of anything that would constitute the former, I suggest that you try the latter.