hi, just wanna say this is a great script you have posted and altough it was posted some time ago it still helped greatly in a project i had recently.
just wanted to add a small remark...
the last section of the code...
For $oWord in $miDoc.Images(0).Layout.Words
$str = $str & $oWord.text & @CrLf
ConsoleWrite($oWord.text & @CRLF)
$sArray [$i] = $oWord.text
$i += 1
Next
_ArrayDisplay($sArray,"OCR Result")
Can be replaced with a much simpler
MsgBox("","OCR Result",$miDoc.Images(0).Layout.Text)
that could also be used if your code is used inside a function as
return $miDoc.Images(0).Layout.Text