Results 1 to 3 of 3

Thread: select and move file

  1. #1

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    using commondialog I select a file
    from anywhere on my system drives.

    how do I move it to C:\Mynewfolder

    Private Sub cmdGetPic_Click()

    'Set the properties of the text control
    CommonDialog1.Filter = "Pictures(*.jpg)|*.jpg*|Gif Files(*.gif,*.gif)|*.htm*|All files(*.*)|*.*"
    CommonDialog1.FilterIndex = 1
    CommonDialog1.FileName = "YourFile"
    CommonDialog1.DefaultExt = "txt"
    CommonDialog1.ShowSave

    'What goes here to do the move or copy
    'preferably move but if not I can kill
    'the file later in the event

    End Sub


  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    use Name()

    Code:
    Private Sub cmdGetPic_Click() 
    
    Dim filename As String
    
    'Set the properties of the text control 
    CommonDialog1.Filter = "Pictures(*.jpg)|*.jpg*|Gif Files(*.gif,*.gif)|*.htm*|All files(*.*)|*.*" 
    CommonDialog1.FilterIndex = 1 
    CommonDialog1.FileName = "YourFile" 
    CommonDialog1.DefaultExt = "txt" 
    CommonDialog1.ShowSave 
    
    filename = CommonDialog1.filename
    
    Name filename As "c:\mynewfolder\" & Dir(filename)
    
    End Sub
    Mark
    -------------------

  3. #3

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    Thank you.

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