OLE automation: Difference between revisions

no edit summary
(omit zkl)
No edit summary
Line 71:
#include lib\ComDispatch.ahk
#include lib\ComVar.ahk</lang>
 
=={{header|M2000 Interpreter}}==
We can use Events, from declared objects and from objects that we get as result from methods, using WithEvents.
<lang M2000 Interpreter>
Module CheckAutomation {
ExitNow=false
Declare WithEvents Alfa "WORD.APPLICATION"
\\ minimize console
Title "Minimized- Waiting", 0
Wait 300
Print "ok"
With Alfa, "Visible", True
Function ALFA_QUIT {
Print "Why you close Word?"
ExitNow=True
}
M=0
Every 20 {
If ExitNow then exit
M++
If M>500 then exit
}
Try {
Method Alfa, "QUIT"
}
Declare Alfa Nothing
if ExitNow then {
Print format$("Finish {0:2} sec", M/1000)
} Else {
Print "Close Word manually"
}
\\ show again console
Title "ok"
}
CheckAutomation
</lang>
 
=={{header|Python}}==
Anonymous user