Click here to Skip to main content
15,887,444 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have an access(2007) application which generates and saves a ppt as slideshow(pps).
The tool opens the pps show for user review and has to wait until user completes viewing the show.
My problem here is how to make access(vba code) to wait until the show is closed?
Like I need to capture the closing event of the ppt show.

Thanks in advance

Regards,
Naresh S.
Posted
Comments
Maciej Los 24-Nov-11 10:56am    
How you run this pps: by Shell(...) function or by OLE automation?

You need to use Timer object (in the MS Access form) ;) and GetObject() function and the API's function: FindWindow[^]

MS Access will be execute Form_Timer() procedure every time when the period of time has been passed.
Sorry, my english isn't pefect!

The idea is: open form in dialog mode and check every second if pps file is opened.

Read more at: http://office.microsoft.com/en-us/access-help/timer-function-HA001228923.aspx[^] and in the MS Access help.

How to do it?
1) create new form
2) insert Label (Label1) on the form
2) copy and paste the code below
VB
Option Compare Database
Option Explicit

Private Sub Form_Load()
    Me.TimerInterval = 1000
End Sub

'here is the procedure where you can check if pps is opened
Private Sub Form_Timer()
'in the example we are showing only actual time ;)
    Me.Label1.Caption = Now
    Me.Repaint
End Sub 
 
Share this answer
 
v2
Set objppShowWindow = objPre.SlideShowSettings.Run.View
            On Error Resume Next
            Do Until objppShowWindow.State = ppSlideShowDone
                If Err.Number <> 0 Then
                    Exit Do
                Else
                    Sleep (1000) ''Wait for 1 second
                End If
            Loop


This solved my issue
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900