-
Hi!
I was wondering if any one can tell
me how I can open & save files from a floppy
using filesystemobject or otherwise.
The pgm calls for saving each line in a listbox and opening it again to demonstrate opening and saving files.I have a hard time understanding that chapter.I have the program
setup where a user can click on the OPEN or SAVE button and a new form loads with 3 controls 1)drive control 2)dir control 3)file control. After this point everything else is greek to me :)
THANKS .
THANKS.
-
First add a reference to Microsoft Scripting Runtime Library.
To open file and show it in a textbox (don't forget to set the MultiLine property to True)
Code:
Dim oFSO As New FileSystemObject
Dim oFile As Object
Set oFile = oFSO.OpenTextFile("F:\Test.txt", ForReading, False, TristateUseDefault)
Text1.Text = oFile.ReadAll
To save the contents of the textbox to a file:
Code:
Dim oFSO As New FileSystemObject
Dim oFile As Object
Set oFile = oFSO.OpenTextFile("F:\Test2.txt", ForWriting, TristateUseDefault)
oFile.Write Text1.Text
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819