A
alrashidmtz
Hi,
I am trying to control ADF scanner (HP Scanjet 8250) using WIA and
VBscript. I can get it to scan once but when the next document loads
the process finish, and I get only one image. The code is below. Are
you willing to do some paid work to troubleshoot this?
Regards,
Dim objWia
Dim IP
Dim Img
Dim i
Set IP = CreateObject("Wia.ImageProcess")
Set Img = CreateObject("Wia.ImageFile")
Set objWia = CreateObject("Wia.Script")
Set objWia = objWia.Create(Nothing)
i=0
Set objSelectedItems = objWia.GetItemsFromUI(0,0)
For Each objItem In objSelectedItems
objItem.Transfer "c:\imagen" & i & ".bmp",false
if i=0 then
Img.LoadFile "c:\imagen" & i & ".bmp"
else
Set Img1 = CreateObject("Wia.ImageFile")
Img1.LoadFile "c:\imagen" & i & ".bmp"
IP.Filters.Add IP.FilterInfos("Frame").FilterID
Set
IP.Filters(IP.Filters.Count).Properties("ImageFile") = Img1
end if
i=i+1
Next
IP.Filters.Add IP.FilterInfos("Convert").FilterID
IP.Filters(IP.Filters.Count).Properties("FormatID") =
"{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}" ' TIF
Set Img = IP.Apply(Img)
Img.SaveFile "c:\imagen.tif"
Al Rashid
(e-mail address removed)
I am trying to control ADF scanner (HP Scanjet 8250) using WIA and
VBscript. I can get it to scan once but when the next document loads
the process finish, and I get only one image. The code is below. Are
you willing to do some paid work to troubleshoot this?
Regards,
Dim objWia
Dim IP
Dim Img
Dim i
Set IP = CreateObject("Wia.ImageProcess")
Set Img = CreateObject("Wia.ImageFile")
Set objWia = CreateObject("Wia.Script")
Set objWia = objWia.Create(Nothing)
i=0
Set objSelectedItems = objWia.GetItemsFromUI(0,0)
For Each objItem In objSelectedItems
objItem.Transfer "c:\imagen" & i & ".bmp",false
if i=0 then
Img.LoadFile "c:\imagen" & i & ".bmp"
else
Set Img1 = CreateObject("Wia.ImageFile")
Img1.LoadFile "c:\imagen" & i & ".bmp"
IP.Filters.Add IP.FilterInfos("Frame").FilterID
Set
IP.Filters(IP.Filters.Count).Properties("ImageFile") = Img1
end if
i=i+1
Next
IP.Filters.Add IP.FilterInfos("Convert").FilterID
IP.Filters(IP.Filters.Count).Properties("FormatID") =
"{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}" ' TIF
Set Img = IP.Apply(Img)
Img.SaveFile "c:\imagen.tif"
Al Rashid
(e-mail address removed)