Link to home
Start Free TrialLog in
Avatar of tracyms
tracyms

asked on

Document Scanning Using Vbscript

I have a scanner script that I got from here:

http://beaukey.blogspot.com/2015/09/document-scan-with-vbsscript-and-wia.html

OPTION EXPLICIT

'--- dim objects...
dim wsh, fso, objWIAdialog, objImage, imgFilename
set wsh=CreateObject("wscript.shell")
set fso=CreateObject("scripting.filesystemobject")
set objWIAdialog = CreateObject("WIA.CommonDialog") 

'--- Start the Scanner dialog box, where a scanner can be selected...
set objImage = objWIADialog.ShowAcquireImage

'--- Save and show the scan if the scan was successful...
If Not objImage Is Nothing Then 
    Randomize
    imgFilename=fso.GetSpecialFolder(2) & "\Scan2BMP" &  Int((999999 - 100000 + 1) * Rnd + 100000) & ".jpg" 
    wscript.echo "Scan stored as BMP in file: " & imgFilename
    objImage.SaveFile imgFilename 
    wsh.run(imgFilename)
End if 

Open in new window


It works fine. I would like to tweak it so after it scans, it opens Adobe (I have the full version on Adode CS) instead of windows Image Viewer. I also don’t want to save the file, just have it scan and open in Adobe – is that possible?
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tracyms
tracyms

ASKER

Thanks!