WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with PowerPoint

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Waiting for PowerPoint Presentation to End


 Keywords: End Complete Finish PowerPoint Event

Question:

I want to display a few powerpoint presentations after each other and do some other things in between. Running the presentation from slide x to y works great but the only problem I have is to detect when the presentation is ending so I can move on to do other stuff before starting the next presentation.

Answer:

objPP = ObjectOpen("powerpoint.application")
;Allows us to view the open PowerPoint window
objPP.Visible = @True
objActWin = objPP.ActiveWindow
pptview = objActWin.View

activeSlide= pptview.slide
nr = activeSlide.slidenumber
lastnr= startSlide
while (( nr >= lastnr ) && ( nr <= endslide )) 
	; 'lastnr' construction used to prevent starting over again when 
	; presentation looped back to the first slide again (due timing problems)
	
	objectClose( activeSlide ) 
	yield
	yield
	activeSlide= pptView.slide
	nr= activeSlide.slidenumber 
	if ( nr == endslide ) then break
	if ( nr > lastNr ) then lastNr= nr
endwhile 

activeTransition= activeSlide.SlideShowTransition 
time= activeTransition.AdvanceTime- 0.4 
; give script last 400msec before ending the slideshow to do some stuff
; ensures a smooth transition
objectClose( activeTransition )
objectClose( activeSlide )
objectclose( pptview )
objectclose( objActWin )
objectclose( objPP )
timeDelay( time ) 


Article ID:   W16644
File Created: 2005:02:18:12:21:44
Last Updated: 2005:02:18:12:21:44