A
asc4john
I'm using the MODI control in an Access Form with VBA. Using the
code, below, from the MSDN help file. When this runs I get an error at
miDoc.Images(0).OCR saying that "Object is not initialized and can't be
used yet" Is this code correct?
Dim miDoc As MODI.Document
Dim miLayout As MODI.Layout
Dim strLayoutInfo As String
Set miDoc = New MODI.Document
miDoc.Create "C:\document1.tif"
miDoc.Images(0).OCR
Set miLayout = miDoc.Images(0).Layout
strLayoutInfo = _
"Language: " & miLayout.Language & vbCrLf & _
"Number of characters: " & miLayout.NumChars & vbCrLf & _
"Number of fonts: " & miLayout.NumFonts & vbCrLf & _
"Number of words: " & miLayout.NumWords & vbCrLf & _
"Beginning of text: " & Left(miLayout.Text, 50) & vbCrLf & _
"First word of text: " & miLayout.Words(0).Text
MsgBox strLayoutInfo, vbInformation + vbOKOnly, _
"Layout Information"
Set miLayout = Nothing
Set miDoc = Nothing
code, below, from the MSDN help file. When this runs I get an error at
miDoc.Images(0).OCR saying that "Object is not initialized and can't be
used yet" Is this code correct?
Dim miDoc As MODI.Document
Dim miLayout As MODI.Layout
Dim strLayoutInfo As String
Set miDoc = New MODI.Document
miDoc.Create "C:\document1.tif"
miDoc.Images(0).OCR
Set miLayout = miDoc.Images(0).Layout
strLayoutInfo = _
"Language: " & miLayout.Language & vbCrLf & _
"Number of characters: " & miLayout.NumChars & vbCrLf & _
"Number of fonts: " & miLayout.NumFonts & vbCrLf & _
"Number of words: " & miLayout.NumWords & vbCrLf & _
"Beginning of text: " & Left(miLayout.Text, 50) & vbCrLf & _
"First word of text: " & miLayout.Words(0).Text
MsgBox strLayoutInfo, vbInformation + vbOKOnly, _
"Layout Information"
Set miLayout = Nothing
Set miDoc = Nothing