Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is wrong with this code - trying to use kodak imaging to scan

Status
Not open for further replies.

Blitz

Technical User
Jul 7, 2000
171
0
0
US
here is my code


Private Sub Command0_Click()
Dim App As Object
Set spObj = CreateObject("imaging.Application")
If spObj.ScannerAvailable = True Then
MsgBox "on"
Else
MsgBox "off"
End If
End Sub

If i can get this to work and dont know what i am missing or doing wrong. I referenced all the kodak image controls but whenever i run this i get:
Run-time error '438':
object doesnt support this property or method

When i click debug it highlights "If spObj.ScannerAvailable = True Then" but i dont know what i need to do to fix it. Thanks for any help.
 

Well you are doing late binding and not referencing the controls to begin with, and since you are trying to do that and the imaging application has very little exposed methods you are going to get that error a lot.

Place an ImgScan1 control on a form and you can test it either way...
[tt]
Option Explicit

Dim MyBooleanValue As Boolean

Private Sub Form_Load()

MyBooleanValue = ImgScan1.ScannerAvailable

If ImgScan1.ScannerAvailable = True Then
MsgBox "True " & MyBooleanValue
Else
MsgBox "False " & MyBooleanValue
End If

End Sub
[/tt]

Good Luck

 
Thank you for the reply although im still completly lost lol. I dont know enough vb to do this and cant find any complete examples of how to scan that i could alter to fit my needs so im about to give up. Thanks again for taking the time to try to help.
 

If you have access to a win 95 machine look in the twain or twain 32 directory under windows. You should find a vb project in there that shows you the basics of the controls.

Good Luck

 
A small point, but I hate to see redundancy in code! In posts above there is some code like -

If boolSomeThing=True Then DoSomething


Are you aware that

If boolSomeThing Then DoSomething

has the same effect (and If NOT(boolSomeThing) has the opposite effect?

Tends to make code more readable!

Phil

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top