Copy a file
Posted by: fredometro on
Jan 1st, 2004 |
Filed under: MS-Access
This function copies a file
Const FOF_NOCONFIRMMKDIR = &H200
Const FOF_FILESONLY = &H80
Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
End Type
Private Declare Function SHFileOperation Lib “shell32.dll” _
Alias “SHFileOperationA” (lpFileOp As SHFILEOPSTRUCT) As Long
Public Function MyFileCopy(txtSource, txtDestination)
Dim lFileOp As Long
Dim lresult As Long
Dim lFlags As Long
Dim SHFileOp As SHFILEOPSTRUCT
Dim chkSilent, chkYesToAll, chkRename, chkDir, chkFilesOnly As Boolean
DoCmd.Hourglass True
lFileOp = FO_COPY
chkYesToAll = True
chkSilent = True
If chkSilent Then lFlags = lFlags Or FOF_SILENT
If chkYesToAll Then lFlags = lFlags Or FOF_NOCONFIRMATION
If chkRename Then lFlags = lFlags Or FOF_RENAMEONCOLLISION
If chkDir Then lFlags = lFlags Or FOF_NOCONFIRMMKDIR
If chkFilesOnly Then lFlags = lFlags Or FOF_FILESONLY
‘
‘ NOTE: By adding the FOF_ALLOWUNDO flag you can move
‘ a file to the Recycle Bin instead of deleting it.
‘
With SHFileOp
.wFunc = lFileOp
.pFrom = txtSource & vbNullChar & vbNullChar
.pTo = txtDestination & vbNullChar & vbNullChar
.fFlags = lFlags
End With
lresult = SHFileOperation(SHFileOp)
‘
‘ If User hit Cancel button while operation is in progress,
‘ the fAborted parameter will be true
‘
DoCmd.Hourglass False
‘If lresult <> 0 Or SHFileOp.fAborted Then Exit Function
‘MsgBox “Operation Complete”, vbInformation, “File Operations”
MyFileCopy = lresult
End Function


December 11th, 2009 at 11:19 pm
Cumbath Bitches
December 11th, 2009 at 11:20 pm
Fresh Big Tits
December 11th, 2009 at 11:21 pm
Big Tit Porno
December 11th, 2009 at 11:22 pm
Tranny Lust
December 11th, 2009 at 11:23 pm
Hardcore Sex Station
December 11th, 2009 at 11:24 pm
Busty Pam
December 11th, 2009 at 11:26 pm
Ashlyn Rae
December 11th, 2009 at 11:27 pm
Rubber Dollies
December 11th, 2009 at 11:28 pm
Josh Hardman
December 11th, 2009 at 11:29 pm
Nasty 19
December 11th, 2009 at 11:30 pm
Young Models
December 11th, 2009 at 11:31 pm
Teen 18
December 11th, 2009 at 11:32 pm
Discreet And Married
December 11th, 2009 at 11:33 pm
Stink Fillers
December 11th, 2009 at 11:34 pm
Interracial Moviesite
December 11th, 2009 at 11:35 pm
Teen Secrets
January 9th, 2010 at 6:02 am
This is my first post I’d like to thank you for such a terrific quality site!
Was thinking this would be a perfect way to introduce myself!
Sincerely,
Monte Phil
if you’re ever bored check out my site!
[url=http://www.partyopedia.com/articles/farm-party-supplies.html]farm Party Supplies[/url].
Add A Comment
You must be logged in to post a comment.