Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub Read_Files()
Dim fso As New FileSystemObject, txtfile, _
fil1 As File, ts As TextStream
fso.CreateTextFile "c:\testfile.txt", True
MsgBox "Writing file"
' Write a line.
Set fil1 = fso.GetFile("c:\testfile.txt")
Set ts = fil1.OpenAsTextStream(ForWriting)
ts.Write "Hello World"
ts.Close
' Read the contents of the file.
Set ts = fil1.OpenAsTextStream(ForReading)
s = ts.ReadLine
MsgBox s
ts.Close
End Sub
Dim objFs as scripting.FileSystemObject
Dim objFolder as scripting.Folder
Dim objFiles as scripting.Files
Set objfs = CreateObject("Scripting.FileSystemObject")
Set objFolder = objfs.GetFolder(strFoldername)
Set objFiles = objFolder.Files
For each objFile in objFiles
... = objfile.DateCreated
... = objFile.DateModified
... = objFile.DateLastAccessed
Next
Dim objFS
Set objFs = CreateObject("Scripting.FileSystemObject")
objFS.MoveFolder strSource,strdestination
Private Function GetFileIntoString(ByVal strFileName As String) As String
'*****
'* Read a file of input into a string.
'*****
Dim objTS As TextStream, _
objFS As FileSystemObject
Dim strResponse As String
Set objFS = New FileSystemObject
On Error Resume Next
' Open file for Reading, Create=NO, ASCII
Set objTS = objFS.OpenTextFile(strFileName, ForReading, False, False)
strResponse = Err.Description
If Len(strResponse) = 0 Then
GetFileIntoString = objTS.ReadAll
End If
objTS.Close
On Error GoTo 0
Set objTS = Nothing
Set objFS = Nothing
If Len(strResponse) > 0 Then
Err.Raise vbObjectError + 513, "GetFileIntoString", _
strFileName & vbCrlf & strResponse
End If
End Function
Dim fs as Scripting.FileSystemObject
Dim a as Scripting.TextStream
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\testfile.txt", True)
a.WriteLine("This is a test.")
a.Close