Microsoft Office Document Imaging (MODI) in VB6 or .Net

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?
 
B

Bob Buckland ?:-\)

Hi Pete,

You may want to also post in the Office Developer newsgroup using the link below on this one and include some specifics (examples)
of how you're trying to manage the MODI linking.

=================
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?>>
--
Please let us know if this has helped,

Bob Buckland ?:)
MS Office System Products MVP

LINKS
A. Specific newsgroup/discussion group mentioned in this message:
news://msnews.microsoft.com/microsoft.public.officedev
or via browser:
http://microsoft.com/communities/newsgroups/en-us/?dg=microsoft.public.officedev

B. MS Office Community discussion/newsgroups via Web Browser
http://microsoft.com/office/community/en-us/default.mspx
or
Microsoft hosted newsgroups via Outlook Express/newsreader
news://msnews.microsoft.com
 
P

Pete B

Bob,

Many Thanks I have done as you suggested.

The Code I have been using is here:-

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