-
add new file
hi!
I am trying to when my user scan image it check how many image in folder and then add +1 image to that folder and save. Please help me where am i wrong in below code cos it scan and save but not add in folder
Code:
Private Sub vstwain1_PostScan(ByVal flag As Long)
If flag <> 0 Then
If vstwain1.errorCode <> 0 Then
MsgBox vstwain1.errorString
End If
Else
Dim lnFileCount As Long
Dim sphotocount As Long
Dim sPhotoFile As String
Dim sNewFile As String
sPhotoFile = Dir(sPhotoPath & "\photo *.jpg")
lnFileCount = lnFileCount + 1
sNewFile = sPhotoPath & "photo" & (lnFileCount) & ".jpg"
Set Image1.Picture = vstwain1.GetCurrentImage
If vstwain1.SaveImage(0, sNewFile) = 0 Then
MsgBox vstwain1.errorString
End If
End If
End Sub
thanks
-
Re: add new file
First you need to determine number of files in a specified directory - there are few methods ubt perhaps simplest one would be to use FileSystemObject.
In your case using function from that link may look like this:
Code:
lnFileCount = GetFileCount(sPhotoPath) + 1
'rest of your code goes here...
-
Re: add new file
i got error
sub or function not define (highlited "getfile')
thanks for reply
-
Re: add new file
u want it like this ??
it saves images in c:\
-
Re: add new file
thanks for reply
yes , same way i need to do how can i do that
-
1 Attachment(s)
Re: add new file
-
Re: add new file
add.rar is exe file can u help me for the code
thanks
-
Re: add new file
the second add.rar file is with code + exe file download the add.rar file in second post