rubix123 Posted July 8, 2014 Share Posted July 8, 2014 Hi. I am trying to get an object event to fire when a power point slide show presentation reaches the end of the slide. There is an event called SlideShowEnd in power point but I can't get it to fire in AutoIt using the ObjEvent. $obj = ObjCreate("PowerPoint.Application") $oEvent = ObjEvent($obj, "SlideEvent_", "SlideShowEnd") Func SlideEvent_SlideShowBegin() MsgBox(0,"", "Hello it works") EndFunc I have created the object and the object event and simply want to test to see if it works by calling a function to display a message box. Any help is much appreciated. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 8, 2014 Moderators Share Posted July 8, 2014 Have you looked at the Powerpoint UDF? = powerpoint I would think you could do this with _PPT_SlideShowEndingSlide "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
rubix123 Posted July 9, 2014 Author Share Posted July 9, 2014 The _PPT_SlideShowEndingSlide is a function to set the last slide in the slideshow. I need to know when it hits the ending slide. Our project is to display a series of advertisements (power point slideshow) on a monitor for a certain duration then pause the slideshow and display a broswer window that shows the lobby wait time. So alternating back and forth. The kicker is management wants to pickup where the slideshow left off each time as it alternates back and forth between the lobby wait time and the slideshow advertisements. The Problem: If the slideshow picks up where it left off and say it's the second to last slide it will hit the end (a blank screen) for the remaining duration until the lobby wait time screen is displayed. I need to find a work-around to tell it to that when it hits the end to loop back to the beginning of the slideshow for the remaining duration. Link to comment Share on other sites More sharing options...
trancexx Posted July 9, 2014 Share Posted July 9, 2014 The OP code never loads the PPT, so no events are fired. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
rubix123 Posted July 9, 2014 Author Share Posted July 9, 2014 I have a loop that calls a function to set some slideshow parameters and then run the slideshow. When the slide show is running and it reaches the end it doesn't capture the power point SlideShowEnd event. I kinda new at this programming thing and I hope the code below helps, otherwise could you explain what you mean a little more Queen F. Elizabeth? expandcollapse popup;------------------------------------------------------------- ;-----------------------Variables----------------------------- HotKeySet("{BACKSPACE}", "Terminate") $obj = ObjCreate("PowerPoint.Application") $oEvent = ObjEvent($obj, "SlideEvent_", "SlideShowEnd") $slideStart = 1 ;------------------------------------------------------------- ;-----------------------Functions----------------------------- Func Terminate() Send("{ESC}") Sleep(500) WinClose("[REGEXPTITLE:CheckInTraining]") WinClose("[REGEXPTITLE:VLC]") Run(@DesktopDir & "\Automated Presentation\EndScript.bat") EndFunc Func setSlideShow() With $obj.ActivePresentation.SlideShowSettings .RangeType = 2 .StartingSlide = $slideStart .LoopUntilStopped = False .Run EndWith Sleep(25000) Send ("S") EndFunc Func resetStartSlide() Sleep(1000) $slideStart = $obj.SlideShowWindows (1).View.Slide.SlideIndex MsgBox(0,"Slide", $slideStart) $obj.ActivePresentation.Close ;$obj.Quit Sleep(2000) EndFunc Func SlideEvent_SlideShowBegin() MsgBox(0,"", "Hello it works") EndFunc ;------------------------------------------------------------- ;--------------------------Main------------------------------- Example() Func Example() While 1 ;$objPPT = _PPT_PowerPointApp() ;$objPresOpen = _PPT_PresentationOpen($objPPT,@DesktopDir ;& "\Automated Presentation\Checkintraining.pptx") ;Local $hDLL = DllOpen("user32.dll") $obj.Presentations.Open(@DesktopDir & "\Automated Presentation\CheckInTraining.pptx") Sleep(4000) WinActivate("[REGEXPTITLE:CheckInTraining]") Sleep(3500) setSlideShow() resetStartSlide() Sleep(2000) ShellExecute(@DesktopDir & "\Automated Presentation\FASPictures1.mp4") Sleep(1000) WinActivate("[REGEXPTITLE:VLC]") Send ("{f}") Sleep(15000) Send ("{f}") WinClose("[REGEXPTITLE:VLC]") Sleep(3000) WEnd Link to comment Share on other sites More sharing options...
trancexx Posted July 9, 2014 Share Posted July 9, 2014 (edited) Does this work for you:Const $ppSlideShowDone = 5 $oPPT = ObjCreate("PowerPoint.Application") $oEvent = ObjEvent($oPPT, "SlideEvent_") $oPresentation = $oPPT.Presentations.Open(@DesktopDir & "\Automated Presentation\CheckInTraining.pptx") $oSlideShow = $oPresentation.SlideShowSettings.Run.View() Do If @error Then ExitLoop Sleep(10) Until $oSlideShow.State = $ppSlideShowDone $oPresentation.Close() Func SlideEvent_SlideShowBegin() MsgBox(4096, "", "SlideShowBegin Fired!") EndFunc Edited July 9, 2014 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Zedna Posted July 9, 2014 Share Posted July 9, 2014 (edited) In example in first post is probably mistake about Begin/End ... $oEvent = ObjEvent($obj, "SlideEvent_", "SlideShowEnd") Func SlideEvent_SlideShowBegin() ... probaly shoud be: ... $oEvent = ObjEvent($obj, "SlideEvent_", "SlideShowEnd") Func SlideEvent_SlideShowEnd() ... Edited July 9, 2014 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
rubix123 Posted July 9, 2014 Author Share Posted July 9, 2014 Queen. Isn't that basically the code I already have thought. I created an object and the object event. Have it open up the powerpoint slideshow and try to fire an event to execute the event function. Link to comment Share on other sites More sharing options...
Richard Robertson Posted July 10, 2014 Share Posted July 10, 2014 Might I suggest building a kiosk application instead of a PowerPoint presentation if you need finer control? It's an easy job to display a full screen image. Link to comment Share on other sites More sharing options...
trancexx Posted July 10, 2014 Share Posted July 10, 2014 Queen. Isn't that basically the code I already have thought. I created an object and the object event. Have it open up the powerpoint slideshow and try to fire an event to execute the event function.Does that mean that the code I posted doesn't work for you?If it doesn't work then check what version of AutoIt you run, and update your installation. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now