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 :
The sourcecode is:
The script continues fine, but no event are fired as the line with 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)
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 ]
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)