Sub WriteLog (strFile, strContent)
Const ForAppending = 8
Dim objFSO, objTS
Set objFSO = CreateObject ("Scripting.FileSystemObject")
Set objTS = objFSO.OpenTextFile (strFile,ForAppending,True)
objTS.WriteLine strContent
objTS.Close
Set objTS = Nothing
Set objFSO = Nothing
End Sub
Usage:
Call WriteLog("source-code.log", "[" & Now & "]: " & "codjng.blogspot.com is not found")