N
Nick Bell
Hi chaps,
I'm trying to use the Windows Image Acquisition scripting model described
at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wia/wia/ref
script1/wiascriptingmodel.asp
.... To grab an from a TWAIN scanner. I'm amazed and happy that the following
subroutine grabs an image from the scanner and saves it to c:\ on XP
Pro/Office XP:
---------------
Dim objWia
Dim objDeviceInfoCollection
Dim objDeviceInfo
Dim objRootItem
Dim objSelectedItems
Dim objItem
Set objWIA = CreateObject("Wia.Script")
Set objDeviceInfoCollection = objWia.Devices
For Each objDeviceInfo In objDeviceInfoCollection
Set objRootItem = objWia.Create(objDeviceInfo)
Set objSelectedItems = objRootItem.GetItemsFromUI(0, 0)
For Each objItem In objSelectedItems
objItem.Transfer("c:\Folder\Filename.bmp")
Next
Next
----------------
Now I'd like to use the OnTransferComplete sub as stated below on this page:
http://msdn.microsoft.com/library/en-us/wia/wia/refscript1/events/_iwiaevent
s/ontransfercomplete.asp
"WIA notifies the script or application when a data transfer, image or
sound, completes successfully. Implement the objWia_OnTransferComplete()
subroutine to allow your script or application to respond to the completion
of the data transfer."
Where do I plumb the event in to Access VBA? I've tried creating a sub
called objItem_OnTransferComplete, and another called
objWIA_OnTransferComplete, but neither capture it.
I'm very grateful for any advice anyone is able to offer
Nick
I'm trying to use the Windows Image Acquisition scripting model described
at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wia/wia/ref
script1/wiascriptingmodel.asp
.... To grab an from a TWAIN scanner. I'm amazed and happy that the following
subroutine grabs an image from the scanner and saves it to c:\ on XP
Pro/Office XP:
---------------
Dim objWia
Dim objDeviceInfoCollection
Dim objDeviceInfo
Dim objRootItem
Dim objSelectedItems
Dim objItem
Set objWIA = CreateObject("Wia.Script")
Set objDeviceInfoCollection = objWia.Devices
For Each objDeviceInfo In objDeviceInfoCollection
Set objRootItem = objWia.Create(objDeviceInfo)
Set objSelectedItems = objRootItem.GetItemsFromUI(0, 0)
For Each objItem In objSelectedItems
objItem.Transfer("c:\Folder\Filename.bmp")
Next
Next
----------------
Now I'd like to use the OnTransferComplete sub as stated below on this page:
http://msdn.microsoft.com/library/en-us/wia/wia/refscript1/events/_iwiaevent
s/ontransfercomplete.asp
"WIA notifies the script or application when a data transfer, image or
sound, completes successfully. Implement the objWia_OnTransferComplete()
subroutine to allow your script or application to respond to the completion
of the data transfer."
Where do I plumb the event in to Access VBA? I've tried creating a sub
called objItem_OnTransferComplete, and another called
objWIA_OnTransferComplete, but neither capture it.
I'm very grateful for any advice anyone is able to offer
Nick