Function copyFile (Byval sSource As String, Byval sDestination As String, Byval bOverWrite As Integer) As Integer On Error Resume Next copyFile = False If isFile (sSource) Then If bOverWrite Or (Not isFile (sDestination)) Then Filecopy sSource, sDestination If isFile (SDESTINATION) THEN COPYFILE = True End If End IFEND Function
example:
If CopyFile ("C: /Temp/temp.doc", "C: /Documents/temp.doc") THEN MSGBOX "File C: /Temp/temp.doc WAS Copied successful." Else Msgbox "File C: / Temp /TEMP.DOC WAS NOT COPIED. "END IF