How to control scanner from Access?

How to control scanner from Access?

am 08.01.2006 03:05:23 von deko

Can anyone point me to VB/VBA code that will control a TWAIN-compliant
scanner?

Re: How to control scanner from Access?

am 08.01.2006 03:31:28 von deko

> Can anyone point me to VB/VBA code that will control a TWAIN-compliant
> scanner?

I found this:

http://www.microsoft.com/downloads/details.aspx?FamilyID=a33 2a77a-01b8-4de6-91c2-b7ea32537e29&DisplayLang=en#filelist

and got this to work:

Public Function scan()
'Required reference: Microsoft Windows Image Acquisition Library v2.0
Dim objDlg As Object
Dim objMgr As Object
Dim i As Integer

Set objDlg = CreateObject("WIA.CommonDialog")
Set objMgr = CreateObject("WIA.DeviceManager")

For i = 1 To objMgr.DeviceInfos.Count
Debug.Print objMgr.DeviceInfos(i).Properties("Name").Value & vbCrLf &
_
"[ " & objMgr.DeviceInfos(i).DeviceID & " ]"
Next

End Function

developing...

Re: How to control scanner from Access?

am 08.01.2006 12:51:18 von deko

Then WIAAutSDK readme file says:

"The Windows Image Acquisition Library v2.0 is only designed to support the
PNG, BMP, JPG, GIF and TIFF image formats. It should not be relied upon to
support other formats, though they may appear to be supported depending on
system configuration."

Is it possible to get PDFs? Why can't I get PDF from WIA?

After WAI produces a TIFF, can it be programmatically converted to PDF?
How?

Re: How to control scanner from Access?

am 08.01.2006 21:33:13 von XXXusenet

"deko" wrote in
news:5vOdnWBwQLYSYV3eRVn-sw@comcast.com:

> After WAI produces a TIFF, can it be programmatically converted to
> PDF? How?

A PDF created from a TIFF is going to be nothing more than a thin
wrapper around a copy of the TIFF.

Do you want to OCR the contents and then create a PDF, with
searchable text? That's more complex and my bet is that there's
nothing COM automatable available.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Re: How to control scanner from Access?

am 08.01.2006 23:26:12 von Stephen Lebans

If you are using Office 2003 then the included MODI App has built in OCR
and can load Tif files. One of the interfaces is an ActiveX control that
does work on an Access form. I've only tested the OCR capabilites on a few
(fax) TIF files but I was amazed at the accuracy.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"David W. Fenton" wrote in message
news:Xns97459E414F3B6f99a49ed1d0c49c5bbb2@127.0.0.1...
> "deko" wrote in
> news:5vOdnWBwQLYSYV3eRVn-sw@comcast.com:
>
>> After WAI produces a TIFF, can it be programmatically converted to
>> PDF? How?
>
> A PDF created from a TIFF is going to be nothing more than a thin
> wrapper around a copy of the TIFF.
>
> Do you want to OCR the contents and then create a PDF, with
> searchable text? That's more complex and my bet is that there's
> nothing COM automatable available.
>
> --
> David W. Fenton http://www.dfenton.com/
> usenet at dfenton dot com http://www.dfenton.com/DFA/

Re: How to control scanner from Access?

am 09.01.2006 00:57:59 von deko

> If you are using Office 2003 then the included MODI App has built in OCR
> and can load Tif files. One of the interfaces is an ActiveX control that
> does work on an Access form. I've only tested the OCR capabilites on a few
> (fax) TIF files but I was amazed at the accuracy.

I discovered MODI only because it was the default app for opening a TIFF
file. Pretty cool, and the OCR is accurate as you say. The question 'to
PDF or not to PDF' now becomes political/cultural one. If everyone can open
a TIFF as easily as a PDF (and you don't need all the embedded bells and
whistles) why bother with PDF? The only reason, as far as I can see (and as
Adobe CEO Bruce Chizen would want everyone to believe), is that PDF is the
only truly portable document format - that is, in the minds of users: "if
it's not Word or PDF, you can't open it". That misguided idea is the
catalyst behind the request that led me down this road in the first place.

I'll have to look into MODI a bit further...

Re: How to control scanner from Access?

am 09.01.2006 01:07:44 von Janice

deko wrote:
>> If you are using Office 2003 then the included MODI App has built
>> in OCR and can load Tif files. One of the interfaces is an ActiveX
>> control that does work on an Access form. I've only tested the OCR
>> capabilites on a few (fax) TIF files but I was amazed at the
>> accuracy.
>
> I discovered MODI only because it was the default app for opening a
> TIFF file. Pretty cool, and the OCR is accurate as you say. The
> question 'to PDF or not to PDF' now becomes political/cultural one. If
> everyone can open a TIFF as easily as a PDF (and you don't need
> all the embedded bells and whistles) why bother with PDF? The only
> reason, as far as I can see (and as Adobe CEO Bruce Chizen would want
> everyone to believe), is that PDF is the only truly portable document
> format - that is, in the minds of users: "if it's not Word or PDF,
> you can't open it". That misguided idea is the catalyst behind the
> request that led me down this road in the first place.

It's probably be much easier to "steal" the text from a Tiff than a
protected PDF....

> I'll have to look into MODI a bit further...
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response

Re: How to control scanner from Access?

am 09.01.2006 02:31:33 von deko

> If you are using Office 2003 then the included MODI App has built in OCR
> and can load Tif files. One of the interfaces is an ActiveX control that
> does work on an Access form. I've only tested the OCR capabilites on a few
> (fax) TIF files but I was amazed at the accuracy.

One way to describe MODI is a TIFF viewer on steroids. While TIFF is a
viable alternative to PDF, if you want to read the TIFF 6.0 Specification
you'll need Adobe's Acrobat Viewer. This is because Adobe owns the
copyright and is effectively the custodian for standard. Still, TIFF is a
scanner-friendly format and a good choice for document imaging.

As for scanner automation from Access, the question (as evidenced by this
thread) leads to a consideration of document imaging: once you acquire an
image, what do you do with it?

This is where Microsoft shows it's strength. Thanks to Ballmer's
"Developers, Developers, Developers" idea, we have things like WIA and MODI.
Both have well documented object models and are easily integrated into
Access. Granted, it's all Microsoft-centric stuff, but I want a solution
not (necessarily) an open source standard.

One thing I found interesting is that ScanSoft (a speech and imaging
technology company now known as Nuance, based in Burlington, MA) developed
the OCR component in MODI. Can anything good come from Massachusetts?

Some helpful sites:

http://www.ilixis.com/developer/modi.html

http://home.earthlink.net/~ritter/tiff/#whatis

Re: How to control scanner from Access?

am 09.01.2006 06:13:30 von deko

> If you are using Office 2003 then the included MODI App has built in OCR
> and can load Tif files. One of the interfaces is an ActiveX control that
> does work on an Access form. I've only tested the OCR capabilites on a few
> (fax) TIF files but I was amazed at the accuracy.

Another useful critter in the MODI tool set is MSPSCAN.EXE - the Microsoft
Office Document Scanning utility. It looks like a front end to WIA. For
the type of document scanning we do, it's all that's needed. I'll be glad
to get rid of PaperPort (a major PITA).

But the MODI VBA Language Reference says: "MODI automation provides powerful
document management and OCR features; however, it does not automate the
document scanning process itself or support image annotation."

So, for what I'm trying to do, I'll need to automate WIA rather than MODI.
This means writing my own MSPSCAN. The one thing I'm not sure how to
replicate is the link to the scanner driver that allows stuff like scanning
multiple page documents with an automatic document feeder. In MSPSCAN, when
the multiple page document option is selected, the scanner's driver/utility
is called and that interface (not MSPSCAN) is used to configure the ADF.

My guess is there's a DLL (viceo.dll?) that was installed with the scanner
driver that I'll need to figure out how to use.