Results 1 to 3 of 3

Thread: Powerpoint Launch for VB issue

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2004
    Posts
    9

    Powerpoint Launch for VB issue

    I am trying to launch a power point from vb6 and have it close after 1 min. I can get the PPT to launch and close just fine but the problem I am having is if I have any window selected for example an excel document, this runs the presentation in the background instead of on top of anything else on the screen. How do I get this to show on top of any other window?

    Thanks,

    Jason

    Code:
        Dim PPT As Object
        Dim Pres As Object
    
        Set PPT = CreateObject("PowerPoint.Application")
        Set Pres = PPT.Presentations.Open("C:\ExcelSheet\SalesScreenInfo.pptx")
        If Pres.SlideShowWindow Is Nothing Then
            Pres.SlideShowSettings.Run
        End

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Powerpoint Launch for VB issue

    Use SetForegroundWindow API to bring it to front.

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Powerpoint Launch for VB issue

    appactivate should also work
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

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