R
RichardF
I have a simple function to copy a file.
If I call this with the following paramerters...
psFrom = C:\12345678901234567890.abc
psTo = C:\12345678901234567890.xyz.abc
The TO file ends up being C:\12345678.abc
Any ideas?
Thankd
RichardF
Here is the function...
Public Function DoFileCopy(psFrom As String, _
psTo As String, _
Optional piFlags As Integer =
FOF_NOCONFIRMATION +_
FOF_SILENT +_
FOF_FILESONLY) As Long
Dim FileOp As tSHFILEOPSTRUCT
Dim lRet As Long
lRet = clErcOK
On Error GoTo AnError
With FileOp
.wFunc = FO_COPY
.pFrom = psFrom
.pTo = psTo
.fFlags = piFlags + FOF_ALLOWUNDO
End With
lRet = SHFileOperation(FileOp)
DoFileCopy = lRet
Exit Function
AnError:
DoFileCopy = Err.Number
End Function
If I call this with the following paramerters...
psFrom = C:\12345678901234567890.abc
psTo = C:\12345678901234567890.xyz.abc
The TO file ends up being C:\12345678.abc
Any ideas?
Thankd
RichardF
Here is the function...
Public Function DoFileCopy(psFrom As String, _
psTo As String, _
Optional piFlags As Integer =
FOF_NOCONFIRMATION +_
FOF_SILENT +_
FOF_FILESONLY) As Long
Dim FileOp As tSHFILEOPSTRUCT
Dim lRet As Long
lRet = clErcOK
On Error GoTo AnError
With FileOp
.wFunc = FO_COPY
.pFrom = psFrom
.pTo = psTo
.fFlags = piFlags + FOF_ALLOWUNDO
End With
lRet = SHFileOperation(FileOp)
DoFileCopy = lRet
Exit Function
AnError:
DoFileCopy = Err.Number
End Function