Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

PowerPoint COM event handler initialization error

$
0
0
Hi, I'm getting this error while trying to initialize a com event handler for Office PowerPoint events. The PowerPoint file is displayed correctly, but no events are captured as the ObjEvent() fails :


err.number is: -2147316576
err.windescription: Type mismatch.

err.description is:
err.source is:
err.helpfile is:
err.helpcontext is: 0
err.lastdllerror is: 0
err.scriptline is: 23
err.retcode is: 0



The sourcecode is:


[ autoit ]         
Local $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Initialize a COM error handler Func MyErrFunc($oError) ConsoleWrite("err.number is: " & @TAB & $oError.number & @CRLF & _          "err.windescription:" & @TAB & $oError.windescription & @CRLF & _          "err.description is: " & @TAB & $oError.description & @CRLF & _          "err.source is: " & @TAB & $oError.source & @CRLF & _          "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _          "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _          "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _          "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _          "err.retcode is: " & @TAB & $oError.retcode & @CRLF & @CRLF) EndFunc Local $AppPowerPoint = ObjCreate("PowerPoint.Application") If Not IsObj($AppPowerPoint) Then MsgBox(0, "Error", "$AppPowerPoint is not an Object.") Else MsgBox(0, "Error", "Successfully created Object $AppPowerPoint.") EndIf Local $pptEvt = ObjEvent($AppPowerPoint, "PowerPointEvent_") ; Initialize PowerPoint COM event handlers Local $OpenPresentation = $AppPowerPoint.Presentations.Open("C:\Users\DagHendrik\Desktop\test.ppt",True, False, False) $OpenPresentation.SlideShowSettings.ShowPresenterView = 0 $OpenPresentation.SlideShowSettings.ShowType = 1 Local $SlideShowWindow = $OpenPresentation.SlideShowSettings.Run() While True Sleep(10) WEnd Func PowerPointEvent_SlideShowNextSlide($obj) ConsoleWrite("GetCurrentSlide = " & ($SlideShowwindow.View.Slide.SlideIndex-1) & "<"& @LF) EndFunc Func PowerPointEvent_SlideShowOnNext($obj) ConsoleWrite("GetCurrentSlide = " & ($SlideShowwindow.View.Slide.SlideIndex-1) & "<"& @LF) EndFunc




The script continues fine, but no event are fired as the line with
[ autoit ]      
Local $pptEvt = ObjEvent($AppPowerPoint, "PowerPointEvent_") ; Initialize PowerPoint COM event handlers
fails.


I'm using the latest autoit (v3.3.8.1, 32 bit) And I'm running Office PowerPoint 2013 32bit on a Windows 8 Pro 64 bit installation.

Any idea why the ObjEvent() fails?

(EDIT: changed to autoit code formatting)

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>