How to Save a TextField Content to a File in VB

632 Views Asked by At

I'm trying to know how to save a content of a TextField to a File, like a .txt, using a Common Dialog, only a command dialog in Visual Basic 6, i need this using a only a common dialog, because i'm trying to do the same aplication in eVB, and eVB does not support this methods:

   Dim objFSO As New Scripting.FileSystemObject
   Dim objStream As Scripting.TextStream

Please help me, i'm needing this so much! Thanks.

2

There are 2 best solutions below

1
On BEST ANSWER
Dim fileHandle As File 
Set fileHandle = CreateObject("FILECTL.File")
fileHandle.Open "filename.txt", 2 
fileHandle.LinePrint "some text"
fileHandle.Close
Set fileHandle = Nothing
1
On

I am not familiar with eVB, but does it support legacy style file operations like this:

Open "filename.txt" for output as #1
Print #1, yourtextfield.text
Close #1