VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Save TXT file

by omides (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 17th November 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Save TXT file

Rate Save TXT file



On Error GoTo Err_Found 
Dim FileName As String 
Dim FileNumber As Integer 
FileName = InputBox("Enter the path for a text file to save", _ 
    "Open", "C:\test.txt", 0, 0) 
If FileName = "" Then Exit Sub 
FileNumber = FreeFile 

Open FileName For Output As FileNumber 
    Print #FileNumber, Text1.Text 
Close FileNumber 
Exit Sub 

Err_Found: 
MsgBox Err.Description & vbCrLf & Err.Number 
End Sub

Download this snippet    Add to My Saved Code

Save TXT file Comments

No comments have been posted about Save TXT file. Why not be the first to post a comment about Save TXT file.

Post your comment

Subject:
Message:
0/1000 characters