All pastes #831323 Raw Edit

Untitled

public text v1 · immutable
#831323 ·published 2007-12-24 20:45 UTC
rendered paste body
Private Sub WriteToLog(str As String)
    Dim LogDir As String, LogFile As String
    LogDir = App.Path & "\logs"
    Dim fs As FileSystemObject
    Dim ts As TextStream
    If DirExists(LogDir) = False Then
        CreateFolder (LogDir)
    End If
    LogFile = App.Path & "\logs\" & "Log_" & qCaption & Chr$(32) & Format(Now, "d-m-yyyy") & ".txt"
    Set fs = New FileSystemObject
    Set ts = fs.OpenTextFile(LogFile, ForWriting, True)
    ts.WriteLine str
    ts.Close
End Sub