Is the file in the correct folder?
Perhaps (just guessing) there is an issue with the spaces and/or punctuation within the proposed file name.
Can you show us your latest code?
Is the file in the correct folder?
Perhaps (just guessing) there is an issue with the spaces and/or punctuation within the proposed file name.
Can you show us your latest code?
Hello. sure:
Private Sub Command493_Click()
Dim Filepath As String
Dim CName As String
CName = Forms![ContractorsDBForm]![Text442]
filename = Me.DocumentsName & ".pdf"
Filepath = DLookup("[ContractorPath]", "querysetup") & CName & DLookup("[expr1]", "querysetup")
Debug.Print CurrentProject.Path & "\quickscan.exe resolution 100 pdf showprogress filename " & Filepath & CName & " " & filename & ""
End Sub
and the result on debug.print is correct as show bellow:
C:\ClientsDB\SBPM\quickscan.exe resolution 100 pdf showprogress filename C:\ClientsDB\SBPM\Alain, Tom\Alain, Tom 101 Employment contract.pdf
ALso i was testing another solution and work ok, but the problem is that using WIA the scanner just pull first page and stop. i cant find a solution to scan pull all pages using WIA
this is the code fot WIA solution
Private Sub Command488_Click()
Dim diagFile As FileDialog
Dim Filepath As String
Dim CName As String
On Error GoTo err_chk
Set diagFile = Application.FileDialog(msoFileDialogSaveAs)
CName = Forms![ContractorsDBForm]![Text442]
filename = Me.DocumentsName & ".pdf"
Filepath = DLookup("[ContractorPath]", "querysetup") & CName & DLookup("[expr1]", "querysetup")
diagFile.title = filename
diagFile.InitialFileName = "" & Filepath & CName & " " & filename & ""
If diagFile.Show Then
fileLocation = diagFile.SelectedItems(1)
Dim scanDiag As Object
Dim image As Object
Set scanDiag = CreateObject("WIA.CommonDialog")
Set image = CreateObject("WIA.ImageFile")
' Dim scanDiag As New WIA.CommonDialog
' Dim image As WIA.ImageFile
Set image = scanDiag.ShowAcquireImage()
image.SaveFile fileLocation
End If
ExitCommand488_Click:
Exit Sub
err_chk:
If Err.Number = 91 Then
Resume ExitCommand488_Click
Else
MsgBox Err.Number & ": " & Err.description
End If
End Sub