Public Function AddStringToTextFile (
FileNameAndPath As String,
WriteString As String,
Optional OnErrReturnStrOnly As Boolean = False
) As String
Write a string to the specified text file, adding to any existing file
The path of the file to write
The text to write to the file
If an error occurs, return the error message only and don't display a dialog
Dim s As String
s = xf.Interact.AddStringToTextFile(FileNameAndPath, WriteString)
s = xf.Interact.AddStringToTextFile(FileNameAndPath, WriteString, OnErrReturnStrOnly)
Dim ErrorStr as String
ErrorStr = AddStringToTextFile("C:\Temp\TempFile.txt", FileText, True)