Dim fs, FileName, txtf
Set fs = CreateObject("Scripting.FileSystemObject")
FileName = "D:\Bank\" + strFileName
If fs.FileExists(FileName) Then
'資料加在文字檔後面
Set txtf = fs.OpenTextFile(FileName, 8, False)
Else
Set txtf = fs.CreateTextFile(FileName, True)
End If
txtf.WriteLine CStr(strString)
Set fs = Nothing
'刪除檔案
fs.DeleteFile (strFileName)
沒有留言:
張貼留言