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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a Text file to read the contents

Status
Not open for further replies.

VRIT

IS-IT--Management
Sep 2, 2002
60
GB
Dear all,

This is probably rather simple but for the life of me I cannot find a solution:

I need to check if a specific files exists depending on previous variables (I've done this, that was simple).

Now I need to be able to open the file and use the contents. The text file will contain anything from 1 to 10 lines of text (depending if it was wordwrapped).

Any ideas ?

Thanks in advace,

VRIT
 
Try something like this:
Code:
Set fso=CreateObject("Scripting.FileSystemObject")
Set f=fso.OpenTextFile("\path\to\file", 1) '1=ForReading
buf=f.ReadAll

Hope This Help
PH.
 
PH,

Thats perfect, exactly what I needed.

Thanks

VRIT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top