How do I read from a text file in Visual Basic???

Beau

Lifer
Jun 25, 2001
17,730
0
76
www.beauscott.com
'---First you have to make refrence to the FileSystemObject:

Dim objFSO as Object
Set objFSO = CreateObject("Scripting.FileSystemObject")

'--- Then Open the text file you want to read from:

Dim objTextFile as Object
St objTextFile = objFSO.OpenTextFile("c:\mytextfile.txt")

'--- Then Read the contents of the text file

MsgBox(objTextFile.ReadAll)