I created a simple app that opens a tif image, performs OCR on it, and displays the ocr results to a textbox on an access form. It works on my machine but not on my coworkers. We both have access 2003 and I can set the reference to the microsoft office document imagining piece on either machine. I've tried using the same tif image on both machines but it just doesn't run on this one machine. Any thoughts would be greatly appreciated. It errors on this line: (Doc1.Images(0).OCR ). Here's the code:
Dim inputFile As String
Dim strRecText As String
Dim Doc1 As MODI.Document
Dim imagecounter As Integer
inputFile = Me.txtFileName
strRecText = ""
Me.txtOcrData = ""
Set Doc1 = New MODI.Document
Doc1.Create (inputFile)
Doc1.Images(0).OCR ' this will ocr all pages of a multi-page tiff file
Doc1.Save ' this will save the deskewed reoriented images, and the OCR text, back to the inputFile
For imagecounter = 0 To (Doc1.Images.Count - 1) ' work your way through each page of results
strRecText = strRecText & Doc1.Images(imagecounter).Layout.Text ' this puts the ocr results into a string
Next
Me.txtOcrData = strRecText
'File.AppendAllText("C:\test\testmodi.txt", strRecText) ' write the OCR file out to disk
Doc1.Close ' clean up
Set Doc1 = Nothing
Dim inputFile As String
Dim strRecText As String
Dim Doc1 As MODI.Document
Dim imagecounter As Integer
inputFile = Me.txtFileName
strRecText = ""
Me.txtOcrData = ""
Set Doc1 = New MODI.Document
Doc1.Create (inputFile)
Doc1.Images(0).OCR ' this will ocr all pages of a multi-page tiff file
Doc1.Save ' this will save the deskewed reoriented images, and the OCR text, back to the inputFile
For imagecounter = 0 To (Doc1.Images.Count - 1) ' work your way through each page of results
strRecText = strRecText & Doc1.Images(imagecounter).Layout.Text ' this puts the ocr results into a string
Next
Me.txtOcrData = strRecText
'File.AppendAllText("C:\test\testmodi.txt", strRecText) ' write the OCR file out to disk
Doc1.Close ' clean up
Set Doc1 = Nothing