Hey there I was wondering how I can append, basically add text to an already written document for example I found this code but I am not understanding how it works:

Option Explicit
Dim objFSO, objFolder, objShell,  objTextFile, objFile
Dim strDirectory, strFile, strText
strDirectory  =  "e:\logs3"
strFile = "\Summer.txt"
strText = "Book Another  Holiday"

' Create the File System Object
Set objFSO =  CreateObject("Scripting.FileSystemObject")

' Check that the  strDirectory folder exists
If objFSO.FolderExists(strDirectory) Then
    Set objFolder = objFSO.GetFolder(strDirectory)
   Set  objFolder = objFSO.CreateFolder(strDirectory)
    WScript.Echo "Just created " & strDirectory
End If

If  objFSO.FileExists(strDirectory & strFile) Then
   Set objFolder =  objFSO.GetFolder(strDirectory)
   Set objFile  = objFSO.CreateTextFile(strDirectory & strFile)
   Wscript.Echo  "Just created " & strDirectory & strFile
End If 

set  objFile = nothing
set objFolder = nothing
' OpenTextFile Method  needs a Const value
' ForAppending = 8 ForReading = 1, ForWriting = 2
Const  ForAppending = 8

Set objTextFile = objFSO.OpenTextFile _
(strDirectory  & strFile, ForAppending, True)

' Writes  strText every time you run this VBScript

'  Bonus or cosmetic section to launch explorer to check file
If  err.number = vbEmpty then
    Set objShell = CreateObject("WScript.Shell")
   objShell.run  ("Explorer" &" " & strDirectory & "\" )
Else WScript.echo  "VBScript Error: " & err.number
End If


'  End  of VBScript to write to a file with error-correcting Code
I don't understand the results of this and what is the need for strDirectory when you can go immediately to the source. Can anyone explain that to me

Thanks for your help