After sloshing through many posts regarding scanning in Access, I have the code below. I want to scan from a button on a form, and have the image save to a file - Can DO! What I am working on now is setting the scanner options using the SetScanCapability method as described here:
When I run this code I get this:
Run-time Error '438':
Object doesn't support this property or method.
Why not? Any ideas welcome! Thanks.
Private Sub Command0_Click()
ImgScan1.ScanTo = UseFileTemplateOnly '4
'Set the image property to a template name.
ImgScan1.Image = "C:\Scans\img"
'SetFile type to TIFF
ImgScan1.FileType = 1
'MultiPage property must be set to true in order to create
'files with more than one page.
ImgScan1.MultiPage = True
'Do not show the scanner's TWAIN UI.
ImgScan1.ShowSetupBeforeScan = False
'Open Scanner
ImgScan1.OpenScanner
'Set Scanner Options to B/W-300dpi
ImgScan1.SetScanCapability 100, 1 'Black and White
ImgScan1.SetScanCapability 101, 300 '300 dpi in X, Y will be semetrical
ImgScan1.SetScanCapability 107, 2 'auto-doc feeder
'Scan without using dialog box.
ImgScan1.StartScan
'Close scanner, release driver
ImgScan1.CloseScanner
End Sub
When I run this code I get this:
Run-time Error '438':
Object doesn't support this property or method.
Why not? Any ideas welcome! Thanks.
Private Sub Command0_Click()
ImgScan1.ScanTo = UseFileTemplateOnly '4
'Set the image property to a template name.
ImgScan1.Image = "C:\Scans\img"
'SetFile type to TIFF
ImgScan1.FileType = 1
'MultiPage property must be set to true in order to create
'files with more than one page.
ImgScan1.MultiPage = True
'Do not show the scanner's TWAIN UI.
ImgScan1.ShowSetupBeforeScan = False
'Open Scanner
ImgScan1.OpenScanner
'Set Scanner Options to B/W-300dpi
ImgScan1.SetScanCapability 100, 1 'Black and White
ImgScan1.SetScanCapability 101, 300 '300 dpi in X, Y will be semetrical
ImgScan1.SetScanCapability 107, 2 'auto-doc feeder
'Scan without using dialog box.
ImgScan1.StartScan
'Close scanner, release driver
ImgScan1.CloseScanner
End Sub