Results 1 to 3 of 3

Thread: FileCopy Command

  1. #1

    Thread Starter
    Hyperactive Member PITBULLCJR's Avatar
    Join Date
    Nov 1999
    Location
    New York
    Posts
    408

    Post

    You know how you can do filesystem.filecopy source name, destination or just filecopy ..... well if i want them to click on a command button and it compies mytxt.txt to a floppy (a drive) and that floppy is not there you automatically get an error. so is there a way to say if it is not there then a msgbox comes up saying so and if it is there then it proceeds with the copying. Thanks

    ------------------
    Sincerely,
    Chris

    just have fun out there and live life to the fullest while it is still here
    Email [email protected]

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Try something like
    Code:
    Private Sub Command1_Click()
        Dim fs As New FileSystemObject
        
        On Error GoTo ErrHnd
        fs.CopyFile "D:\MyFile.txt", "a:\"
        
        Exit Sub
    ErrHnd:
        If Err.Number = 76 Then
            MsgBox "Drive not ready."
        End If
    End Sub
    ------------------

    Serge

    Senior Programmer Analyst
    [email protected]
    [email protected]
    ICQ#: 51055819

  3. #3

    Thread Starter
    Hyperactive Member PITBULLCJR's Avatar
    Join Date
    Nov 1999
    Location
    New York
    Posts
    408

    Post

    Hey thanks. I had to change it around a little cause it wasn't error 76 and it is like filecopy not copyfile but thats ok thanks again serge!!!

    ------------------
    Sincerely,
    Chris

    just have fun out there and live life to the fullest while it is still here
    Email [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width