I need to do a simple check to see if a file exists.
Ie -
If C:Myfile.doc exists Then
a
else
b
end if
The reason I need this is I'm creating an XML file, but the script I'm using only appends to the end of the file, rather than overwriting it.
FYI, the script is:
Set fl = New Scripting.FileSystemObject
Set txt = fl.OpenTextFile(varCurrentDirectory & "\" & filename1 & "_Attachment1.xml", ForAppending, True)
Ie -
If C:Myfile.doc exists Then
a
else
b
end if
The reason I need this is I'm creating an XML file, but the script I'm using only appends to the end of the file, rather than overwriting it.
FYI, the script is:
Set fl = New Scripting.FileSystemObject
Set txt = fl.OpenTextFile(varCurrentDirectory & "\" & filename1 & "_Attachment1.xml", ForAppending, True)