|
-
Oct 9th, 2000, 10:21 AM
#1
Thread Starter
Lively Member
I am having trouble figuring out how to save the contents of a textbos as a text file to a specific location without prompting the user. Can anyone help?
-
Oct 9th, 2000, 10:33 AM
#2
Fanatic Member
Does this help ?
Code:
Private Sub Command1_Click()
Open "c:\testfile.txt" For Output As #1
Print #1, Text1.Text
Close #1
End Sub
-
Oct 9th, 2000, 10:36 AM
#3
Frenzied Member
I think using FreeFile is a handy method for remembering filenumbers, this is especially handy with multiple files:
Code:
Dim fn As FreeFile
Open "file" for output as #fn
Print #fn, text1.text
Close 'this will close all open files, if you use Close #fn it will only close this file.
And yes Jbart I think it helps (are you dutch?)
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 9th, 2000, 10:45 AM
#4
Fanatic Member
Thanks Jop ! I keep forgetting about FreeFile. So far I have only written one program that needs multiple input and output statements for text files.
Not dutch, Texan. Have some Swiss roots from back in the 1800's though.
-
Oct 9th, 2000, 10:51 AM
#5
Thread Starter
Lively Member
I think that helps... let me see what I can do with it.
-
Oct 9th, 2000, 10:54 AM
#6
Frenzied Member
EEK! 
Code:
Dim fn As Integer
fn = FreeFile
Open "file" for output as #fn
Print #fn, text1.text
Close 'this will close all open files, if you use Close #fn it will only close this file.
This is the correct code!
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 9th, 2000, 11:07 AM
#7
Thread Starter
Lively Member
With a little adapting it does what is required... thanks to all.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|