.Open
.LoadFromFile strTextFile
.Position = 0
strData = .ReadText(adReadAll)
End WithClose Stream object.
stm.CloseCase 2FSO
Set fso = CreateObject(“Scripting.FileSystemObject”)
Set txt = fso.OpenTextFile(FileName:=strTextFile, _
IOMode:=ForReading)Read all data from file.
strData = txt.ReadAllClose file.
txt.CloseCase 3VB
Open text file for reading data.
Open strTextFile For Input As #2
Do While Not EOF(2)Save data from a line in the text file to a variable.
Input #2, strLine
strData = strData & IIf(strData <> “”, _
vbCrLf, “”) & strLine
LoopClose file.
Close #2End SelectWorking with Files and Folders 9