Dear Helpers,
nice to be in this Forum, appriciate it and hope you can help me.
Im using Microsoft Office 2010 and want to make a Macro in Excel to extract Text from a PDF via MODI (Microsoft Office Document Imaging).
And later getting it into a Worksheet, but thats a different business.
I got this Code here:
Sub TestWords()
Dim miDoc As MODI.Document
Dim miWord As MODI.Word
Dim strWordInfo As String
' Load an existing TIFF file.
miDoc.Create "C:\Users\gast_v\Desktop\test2.tif"
' Perform OCR.
miDoc.Images(0).OCR
' Retrieve and display word information.
Set miWord = miDoc.Images(0).Layout.Words(2)
strWordInfo = _
"Id: " & miWord.ID & vbCrLf & _
"Line Id: " & miWord.LineId & vbCrLf & _
"Region Id: " & miWord.RegionId & vbCrLf & _
"Font Id: " & miWord.FontId & vbCrLf & _
"Recognition confidence: " & _
miWord.RecognitionConfidence & vbCrLf & _
"Text: " & miWord.Text
MsgBox strWordInfo, vbInformation + vbOKOnly, _
"Word Information"
Set miWord = Nothing
Set miDoc = Nothing
End Sub
The Error Message is: "Runtime Error -2147417848 (80010108) / The Method 'OCR' for the Object 'IImage' has failed" and Debugging selects the "miDoc.Images(0).OCR"
So the only Solution i found is to change it from "late binding" to "early binding" but as i think it is "early binding" already, or?
MODI is working and i also referenced MODI in Excel, same as i registered the "MDIVWCTL.DLL".
i googled around a lot and searched in many forums but i couldnt find any solution,
would be glad if anybody can help.
Thanx i regards,
Rene