OLE Automation   is an inter-process communication mechanism based on   Component Object Model   (COM) on Microsoft Windows.



Task

Provide an automation server implementing objects that can be accessed by a client running in a separate process.

The client gets a proxy-object that can call methods on the object.

The communication should be able to handle conversions of variants to and from the native value types.




 
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
 