您好我想從一個網站粘貼到txt文檔的一些數據,是否有可能粘貼在一個新的行而不覆蓋文件? 這是我的代碼,粘貼到一個txt文件沒有覆蓋
Set app = CreateObject("Shell.Application")
For Each window In app.Windows()
If InStr(1, window.FullName, "iexplore", vbTextCompare) > 0 Then
Set ie = window
Exit For
End If
Next
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("output.txt", 2, True,utf-2)
f.Write ie.Document.All.Item("resltext").innerText
f.Close
所以你基本上嘗試打開追加模式的文件嗎? – Marged
@ marged正確 – jacob
然後你的解決方案在下面的答案。嘗試在提問之前閱讀文檔 – Marged