Results 1 to 2 of 2

Thread: Want to check if PowerPoint presentation show has completed in VB

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2011
    Location
    Hull, UK
    Posts
    38

    Question 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.

    Your help would be appreciated

    Badgersoft333

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Want to check if PowerPoint presentation show has completed in VB

    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.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width