Public Function MoveFiles(MoveFileName As String)
'this is the function that is going to do all of the work
'this function will take the filename that has come in and
'find it's directory using the explore function, if a directory
'is not found then one will be created
'it will then try to find the filename of the file that it is
'looking for, if one is found then this will generate and error
'if no file is found the the filename will be moved and success has
'been made
Dim result As String
Dim count As Integer
Dim answer As Integer
Dim FilePath As String
Dim NewFilePath As String
Dim AlreadyThere As String
Dim ActionValue As Integer
Dim CaptionValue As Integer
FilePath = GetFiles & MoveFileName
NewFilePath = MoveLocation & MoveFileName
CaptionValue = 2
StatusCaptionCase (CaptionValue)
If MoveFileName = "" Then
result = FileFinder(GetFiles)
count = CInt(result)
count = count - 1
FileCopy FilePath, NewFilePath
answer = 1
Else
'FileCopy FilePath, NewFilePath
'if there is this file in the directory already then
'raise and error and do not move the file
'need to create the new folder name, which is the opp number
'which is the first set of numbers before the first deliminitor
SaveFile (MoveFileName)
answer = 1
ActionValue = answer
If ActionValue = 3 Or ActionValue = 4 Then
CaptionValue = 3
StatusCaptionCase (CaptionValue)
Else
CaptionValue = 0
StatusCaptionCase (CaptionValue)
End If
'write to the lstReport what was done
'example "Moved file from here to there
ActionCase (ActionValue)
lstFile.AddItem FileName
End If
End Function
Public Function MoveFileTemp(MoveToTempFileName As String)
Dim result As String
Dim count As Integer
Dim answer As Integer
Dim FilePath As String
Dim NewFilePath As String
Dim AlreadyThere As String
Dim ActionValue As Integer
Dim CaptionValue As Integer
FilePath = GetFiles & MoveToTempFileName
NewFilePath = MoveTempLocation & MoveToTempFileName
CaptionValue = 2
StatusCaptionCase (CaptionValue)
If MoveToTempFileName = "" Then
result = FileFinder(GetFiles)
count = CInt(result)
count = count - 1
FileCopy FilePath, NewFilePath
answer = 1
Else
FileCopy FilePath, NewFilePath
'if there is this file in the directory already then
'raise and error and do not move the file
answer = 5
ActionValue = answer
If ActionValue = 3 Or ActionValue = 4 Then
CaptionValue = 3
StatusCaptionCase (CaptionValue)
Else
CaptionValue = 0
StatusCaptionCase (CaptionValue)
End If
'write to the lstReport what was done
'example "Moved file from here to there
ActionCase (ActionValue)
lstError.AddItem FileName
End If
End Function