VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



The Easy way to make a copy of a file and change the file type to whatever you want. Just need a Di

by Misael (2 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 15th July 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

The Easy way to make a copy of a file and change the file type to whatever you want. Just need a Dir1, file1, commmand1,

Rate The Easy way to make a copy of a file and change the file type to whatever you want. Just need a Di



Dim a As String

Private Sub Command1_Click()
On Error Resume Next
FileCopy Dir1.Path + "\" + File1.FileName, _
Dir1.Path + "\" + Text1.Text
File1.refresh
End Sub

Private Sub Command2_Click()
Kill (Dir1.Path & "\" & File1.FileName)
File1.Refresh
End Sub

Private Sub Dir1_Change()
File1.FileName = Dir1.Path
End Sub

Private Sub File1_Click()
On Error Resume Next
a = VBA.Format$(FileLen(Dir1.Path & "\" & File1.FileName), "###,###,###")
Label1.Caption = "Size: " & a
End Sub

Private Sub Form_Load()
Dir1.Path = "C:\"
command1.caption = "Rename"
command2.caption = "Delete"
End Sub


Download this snippet    Add to My Saved Code

The Easy way to make a copy of a file and change the file type to whatever you want. Just need a Di Comments

No comments have been posted about The Easy way to make a copy of a file and change the file type to whatever you want. Just need a Di. Why not be the first to post a comment about The Easy way to make a copy of a file and change the file type to whatever you want. Just need a Di.

Post your comment

Subject:
Message:
0/1000 characters