Full Version: Using The Scanner In Access
UtterAccess Discussion Forums > Microsoftฎ Access > Access Automation
jddiven
I’ve written a MS Access program to scan signed record of receipts. The program interfaces with the scanner using wia.commondialog. It scans the record of receipts, stores the image to a networked storage device and inserts a link to the image into an existing OBDC database allowing the user of that database to view it on demand.

It works, however, the rub is that the image is stored in portrait format and I must manually rotate it to landscape format before the OBDC database will recognize it. Here is the code that I use to contact the scanner.
'''''''''''''''''''''''''''''''''''''''''''''''’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’
' FUNCTION '
' Scan() '
' Call the scanner and save scanned image '
''''''''''''''''''''''''''''''''''''''''''''''’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’'
Public Function scan()
Dim commondialog1 As Object
‘Dim dm As Object
Dim img As Object
Dim strSave As String
Set commondialog1 = CreateObject("WIA.commondialog")
Set img = commondialog1.ShowAcquireImage
strSave = "\\xxx.xxx.x.xxx\Logistics_Image_Files\" & company_name & "\"
' Check to make sure that the directory exists and create if it doesn't
CreateDirIfRequired (strSave)
strSave = strSave & [company_name] & " " & [op_por_date] & " ISSUE " & Left$([person_name], InStr([person_name], ",") - 1)
img.SaveFile (strSave & ".jpg")
End Function

I'm starting to think that the img.SaveFile line doesn't really convert the file to a true jpeg file and when I open it manually and rotate it, it is tnen saved as a true .jpg. Any thoughts?
MikeLyons
Supposedly WIA can perform rotation (I haven't really messed around with it so cannot speak from experience).

I found this as a starting point:

http://msdn.microsoft.com/en-us/library/wi...v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/wi...v=vs.85%29.aspx


Mike
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.