Open text file can be opened using "Scripting.FileSystemObject"
OpenTextMode represents the File Read mode and Any Text file can be opened in the following modes
ForReading 1 Open a file for reading only. You can't write to this file.
ForWriting 2 Open a file for writing.
ForAppending 8 Open a file and write to the end of the file.
Syntax
filename = "c:\sample.txt"
OpenTextMode= 2
Set OpenTextMode_Obj = Createobject("Scripting.Filesystemobject")
If OpenTextMode_Obj.FileExists(filename) = true Then
set r1 = OpenTextMode_Obj.OpenTextFile filename,OpenTextMode
else
ExitTest
End If
Msgbox r1.readall()
No comments:
Post a Comment
Note: only a member of this blog may post a comment.