I used this to put text in the box:
FileNum = FreeFile
Open WinDir + "\System32\Drivers\etc\Hosts" For Input As FileNum
TxtView.Text = Input(LOF(FileNum), FileNum)
H = TxtView.Text
Close FileNum
Now all the text is in the textbox as well as in the "H" variable which I
need to pass somewhere to edit it and resave it to the source file again??
but you cant open H as a file, and I haven't found a way , for when I add or
delete sections from the textbox, to re-evaluate the H to reflect the
changes I made.
I'm thinking I could use
Write #FileNum, H
to write back to the source file once I made changes within the textbox.
My problem is to update the H variable once changes are made within the
textbox
"Bob Butler" <ti*******@nospam.com> wrote in message
news:SMoOa.147141$Dr3.55188@fed1read02...
"Option^Explicit" <te********@shaw.ca> wrote in message
news:7H***********************@news3.calgary.shaw. ca What I'm trying to do:
Open a text file and display the contents in a text box (I've done
this)
Need to be able to edit the file from within the textbox and have it
save back to the source file.(can't figure how to do this)
I was thinking on the Open for Output or Append, but I can't get it to
accept a variable(TextBoxText) to open(since it's not a file) , what
would be the simplest way to accomplish this task?
how did you get the filename to open in order to put the contents in the
textbox?
you'll need to save that filename so that you can rewrite it
ff=freefile
open filename for output as #ff
put #ff,,text1.text
close #ff