Copying files

B

bilbo+

Hi there, i have a button on my form which when clicked creats 5 new folders
in a new directory. I was wondering how i would go about copying two files
from a diorectory and putting them in the newly created folder as well each
time the button is pressed, thanks! WK
 
B

bilbo+

Hi again, i dont know what im doing wrong...
but this is what im using but it doesnt seem to work, it creates the folders
but doesnt copy the files accross. I want it to go into the relevant jobno
directory that has jsut been created.. thanks

Private Sub Command169_Click()
Dim strPath As String

strPath = "\\Server\CKS Database\CKS\Data\" & Me.JobNo
If Len(Dir(strPath, vbDirectory)) = 0 Then
MkDir (strPath)
MkDir (strPath & "\Services")
MkDir (strPath & "\Drawings")
MkDir (strPath & "\Invoices")
MkDir (strPath & "\Sales")
MkDir (strPath & "\Suppliers")
MkDir (strPath & "\Emails")
MkDir (strPath & "\Emails\PKL")
MkDir (strPath & "\Emails\Client")
MkDir (strPath & "\Emails\Misc")
FileCopy "\\Server\CKS Database\CKS\Hire Quote.doc", "strPath"
FileCopy "\\Server\CKS Database\CKS\Hire Calc.XLS", "strPath"

End If
Shell "explorer.exe " & strPath, vbNormalFocus
 
Top