Q1 = If there is only 1 textbox with filenames (the original with index=0 ) then there are no copies: so no files dropped.
Place this code at the beginning of the command code:
Q2 = I have also added the possibility if the user just not want to uverwrite this one file.
The program continues with the next file.
Q3 = In the copy code is also added a var LOGTEXT(string)
which keep track of the copied files.
Just dump this data in a textfile with:
Place this code at the beginning of the command code:
Code:
'§ check if Files to copy <> 0 If TextFiles.Count = 1 Then MsgBox "There are no files to copy !" & vbNewLine & _ "Please, drop files into the Dropzone !" Exit Sub End If
The program continues with the next file.
Code:
'§ Make copies For FILEidx = 1 To Val(CopyTimes(STARTFILEidx).Text) FILETO = NAME & "(" & FILEidx & ")" & "." & EXTENTION If Dir(SaveTo.Text & "\" & FILETO) <> "" Then _ MESSAGE = MsgBox("The file " & FILETO & " exist !" & vbNewLine & _ "Replace ? [Yes]" & vbNewLine & _ "No for only this one [No]" & vbNewLine & _ "Cancel All [Cancel]", vbYesNoCancel) If MESSAGE = vbCancel Then Exit Sub If MESSAGE = vbNo Then NMBRCOPIES = NMBRCOPIES - 1 GoTo NextFile End If FileCopy TextFiles(STARTFILEidx), SaveTo.Text & "\" & FILETO COPIESMADE = COPIESMADE + 1 LabelProgress.Caption = "Progress : " & COPIESMADE & "/" & NMBRCOPIES & " copy-ed" ShapeProgress.Width = (COPIESMADE / NMBRCOPIES) * ShapeProgressBack.Width LOGTEXT = LOGTEXT & FILETO & vbNewLine '§ add filename for printing log NextFile: Next Next
which keep track of the copied files.
Just dump this data in a textfile with:
Code:
Private Sub ComSaveLog_Click() Dim MESSAGE As Variant Dim OUTPUTFN As Integer If Dir(SaveTo.Text & "\Log.txt") <> "" Then _ MESSAGE = MsgBox("The file Log.txt exist !" & vbNewLine & "Overwrite ?", vbOKCancel) If MESSAGE = vbCancel Then Exit Sub OUTPUTFN = FreeFile On Error GoTo ErrWriting Open SaveTo.Text & "\Log.txt" For Output As #OUTPUTFN Print #OUTPUTFN, LOGTEXT Close #OUTPUTFN Exit Sub ErrWriting: Close #OUTPUTFN MsgBox ("There is an error writing the settings file !") End Sub
Comment