Microsoft Office Document Imaging(MODI) - VB6/.Net does it work?

P

Pete B

I have written some simple VB to read a folder of tif images and
perform OCR on them and output the text to a text file. Everytime I try
to execute the code in VB6 I get the message IO Error and are unable to
create the document/ open a tif. I put the same code into msaccess 2003
and it worked straight away.

Does anyone know if this is limited to work in Office 2003? will it
work in VB6 or .Net?
 
P

Pete B

Someone suggested i place the code I am using :-

Private Sub Command0_Click()

Dim fso As Scripting.FileSystemObject
Dim fldr As Scripting.Folder
Dim f As Scripting.File
Dim midoc As MODI.Document
Dim miLayout As MODI.Layout
Dim txtstream As Scripting.TextStream

Dim filenameStr As String

Set fso = New Scripting.FileSystemObject
Set fldr = fso.GetFolder(Text1)
Set midoc = New MODI.Document

For Each f In fldr.Files

If UCase(Right(f, 3)) = "TIF" Then

filenameStr = f

midoc.Create filenameStr

midoc.OCR miLANG_ENGLISH, True, True

Set miLayout = midoc.Images(0).Layout

filenameStr = Left(f, Len(f) - 4) & ".txt"
Set txtstream = fso_OpenTextFile(filenameStr, ForWriting, True)

txtstream.WriteLine miLayout.Text

End If


Next

Set miLayout = Nothing
Set midoc = Nothing
Set txtstream = Nothing

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top