title: autoit modi.document error Variable must be of type "Object"
body: <pre><code>#include &lt;Constants.au3&gt;
  #include &lt;ScreenCapture.au3&gt;
  #Include &lt;Misc.au3&gt;
  #include &lt;Array.au3&gt;
  #include &lt;GDIPlus.au3&gt;
  
  
  $image = @MyDocumentsDir &amp; "\aaa_teste.jpg"
  ConsoleWrite(OCR($image))
  
  
  Func OCR($Image)
      Local $miDoc, $Doc
      Local $str
      Local $oWord
      Local $sArray[500]
      Local $as_Text = ""
  
  
      $miDoc = ObjCreate("MODI.Document")
      ConsoleWrite("ObjCreate - The error value is: " &amp; @error &amp; @CRLF)
      $miDoc.Create(@TempDir &amp; '\OCR_ImageResize.jpg')
      ConsoleWrite("Create - The error value is: " &amp; @error &amp; @CRLF)
      $miDoc.Ocr(9, False, False)
      ConsoleWrite("Ocr - The error value is: " &amp; @error &amp; @CRLF)
  
      If $Error = False Then
          $i = 0
          For $oWord in $miDoc.Images(0).Layout.Words
  
              $str = $str &amp; $oWord.text &amp; @CrLf
                  ConsoleWrite($oWord.text &amp; @CRLF)
              $sArray [$i] = $oWord.text
              $i += 1
  
          Next
  
          $as_Text = _ArrayToString($sArray," ",0)
          $as_Text = StringReplace($as_Text, "  ", "", 0)
  
      ElseIf $Error = True Then
  
          $Error = False
      EndIf
  
      $miDoc.Close(False)
      Return $as_Text
  
  EndFunc
  </code></pre>
  
  <p>I`m trying read a text from a screencapture The error is:</p>
  
  <p>"C:\Users\jose.barbosaneto\Desktop\TESTE.au3" (23) : ==> Variable must be of type "Object".:
  $miDoc.Create(@TempDir &amp; '\OCR_ImageResize.jpg')
  $miDoc^ ERROR </p>
  
  <p>Please help me</p>