OLE automation: Difference between revisions
Content added Content deleted
(omit zkl) |
No edit summary |
||
Line 71: | Line 71: | ||
#include lib\ComDispatch.ahk |
#include lib\ComDispatch.ahk |
||
#include lib\ComVar.ahk</lang> |
#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}}== |
=={{header|Python}}== |