VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



File Save Save As and Open ( I was working with the last code submitted and saw that the file open

by Anthony Staunton (3 Submissions)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Tue 8th August 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

File Save Save As and Open ( I was working with the last code submitted and saw that the file open doesnt work , it requires a little tweaking

API Declarations


'hopes that this will work because if it doesnt there wil be alot of people angry with all his postings

Rate File Save Save As and Open ( I was working with the last code submitted and saw that the file open



If Error then err
cdialog.Filter="Text (*.txt)|*.txt|"
cdialog.ShowSave
Open cdilaog.FileName For output As #1
Print #1, TextBox
Close #1
err:
End Sub

Private Sub Open()
If Error Then err
cdialog.Filter="Text (*.txt)|*.txt|"
cdialog.ShowOpen
Open cdilaog.Filename As #1
Print TextBox, #1
Close #1
Main.Caption=cdialog.FileName
err:
End Sub

Private Sub Save()
If Error The Err
cdialog.Filter="Text (*.txt)|*.txt|" 'this is here to provide uniformity
If cdilaog.FileName="" Then Save_As ' if there is no filename this will send the program to Save As to ask for a file name or else it will carry on
Open cdilaog.Filename For Output As #1 ' This opens the file if it has a name then saves the contents of the textbox into it.
Print #1, TextBox
Close #1
err:
End Sub


Download this snippet    Add to My Saved Code

File Save Save As and Open ( I was working with the last code submitted and saw that the file open Comments

No comments have been posted about File Save Save As and Open ( I was working with the last code submitted and saw that the file open . Why not be the first to post a comment about File Save Save As and Open ( I was working with the last code submitted and saw that the file open .

Post your comment

Subject:
Message:
0/1000 characters