Bringing PowerPoint Show - .ppsm to front
Hi gents
I'm wrinting some VB6 code, where i open a powerpont presentation show, which works great under debug mode, but as soon as I build the .exe and run the software, the ppsm file is behind the vb6 application.
How can i bring the ppsm application to the front and maximised as a show?
Can anyone help please, ta
Jason
Re: Bringing PowerPoint Show - .ppsm to front
Just a note - I'm using Windows 7. I someone can help me it would be great, really need this working soon. Ta
Re: Bringing PowerPoint Show - .ppsm to front
Can we see your file export/save? Are you using ".ShowType = ppShowTypeKiosk"? In my use of PPT, I don't do ppsm's, just slide packs (ppt, pptx). All I do is is make it visible and it appears on top of all apps (including my VB)...So, if you could post your export routine, I might be able to assist.
Re: Bringing PowerPoint Show - .ppsm to front
Sorr for late replay here is my code
Code:
'Option Explicit
Dim WithEvents oPPTAppEvents As PowerPoint.Application
Dim oPPTApp As PowerPoint.Application
Dim oPPTPres As PowerPoint.Presentation
Dim PresPath As String
Set oPPTApp = CreateObject("PowerPoint.Application")
If Not oPPTApp Is Nothing Then
Set oPPTAppEvents = New PowerPoint.Application
List1.AddItem "All slide show events are being monitored..."
Txt_Data(4).Text = Format(Now(), "dd-mmm-yy hh:mm:ss")
With oPPTApp
Set oPPTPres = .Presentations.Open(PresPath, , , True)
'Set oPPTPres = .Presentations.Open(PresPath, , , False)
If Not oPPTPres Is Nothing Then
oPPTPres.SlideShowSettings.Run
Else
MsgBox "The code could not open the specified file." & _
"Check if the file is present at the location.", _
vbCritical + vbOKOnly, "PowerPoint Automation Example"
End If
End With
Else
MsgBox "The code failed to instantiate PowerPoint session.", _
vbCritical + vbOKOnly, "PowerPoint Automation Example"
End If
Re: Bringing PowerPoint Show - .ppsm to front
I would like very much to know how to do this, so then I am going to post and then find out for myself...
Thanks, again!!
Re: Bringing PowerPoint Show - .ppsm to front
Mine works - It seems to work when I minimize all the forms, and then show them again afterwards! not sure if this is the best way though?
Re: Bringing PowerPoint Show - .ppsm to front
I put your code in a command button, changed one of your DIM statements (removed withEvents), changed your 'TRUE' option to false, and it works just fine.....try this in a commandbtn (changed the path/filename to YOURS)/
Code:
Dim oPPTAppEvents As PowerPoint.Application 'I REMOVED "WITHEVENTS"
Dim oPPTApp As PowerPoint.Application
Dim oPPTPres As PowerPoint.Presentation
Dim PresPath As String
Set oPPTApp = CreateObject("PowerPoint.Application")
PresPath = App.Path & "\test.ppsx" 'CHANGE THIS TO THE PATH AND FILENAME OF YOUR PPT PRESENTATION
If Not oPPTApp Is Nothing Then
Set oPPTAppEvents = New PowerPoint.Application
' List1.AddItem "All slide show events are being monitored..." 'I COMMENTED OUT THIS, AND NEXT LINE, AS I DONT HAVE THESE CONTROLS ON MY FORM...YOU CAN LEAVE THEM UNCOMMENTED
' Txt_Data(4).Text = Format(Now(), "dd-mmm-yy hh:mm:ss")
With oPPTApp
Set oPPTPres = .Presentations.Open(PresPath, , , False) 'I CHANGED TRUE TO FALSE (LIKE YOU ORIG HAD-NEXT LINE)
'Set oPPTPres = .Presentations.Open(PresPath, , , False)
If Not oPPTPres Is Nothing Then
oPPTPres.SlideShowSettings.Run
Else
MsgBox "The code could not open the specified file." & _
"Check if the file is present at the location.", _
vbCritical + vbOKOnly, "PowerPoint Automation Example"
End If
End With
Else
MsgBox "The code failed to instantiate PowerPoint session.", _
vbCritical + vbOKOnly, "PowerPoint Automation Example"
End If
Re: Bringing PowerPoint Show - .ppsm to front
Cool hey, that was really good. So then we can be able to make a PowerPoint Show work better for us, programmers!!