Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file system object help

Status
Not open for further replies.

DawJam

IS-IT--Management
Apr 21, 2004
13
US
i am kinda new to vb and have been trying to mess around with the file system object in my programs. I make sure that I follow the instructions in my vb 6 book word for word but I still cant get a text file to output to a text box. any ideas for a simple solution?
 
What is the code you are using?


[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
1. Make sure you have a reference set to Microsoft Scripting Runtime.
2. Make sure you have the MultiLine property of the Textbox set to true if your text file has multiple lines.

Example (Will read the whole file into the texbox):

Dim fso As FileSystemObject, InStream As TextStream, InputData As String
Set fso = CreateObject("Scripting.FileSystemObject")
Set InStream = fso_OpenTextFile("C:\YOURTEXTFILENAME.TXT", ForReading)
Text1.Text = InStream.ReadAll
InStream.Close
Set InStream = Nothing
Set fso = Nothing

Swi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top