|
-
Jul 15th, 2010, 01:06 PM
#1
Thread Starter
New Member
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
-
Jul 15th, 2010, 01:25 PM
#2
Re: Powerpoint Launch for VB issue
Use SetForegroundWindow API to bring it to front.
-
Jul 16th, 2010, 04:03 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|