Set abc = CreateObject("scripting.filesystemobject")
Set ntxt = abc.opentextfile("C:\Users\Administrator\Desktop\新建文本文档 (2).txt", 8, True)
ntxt.writeline """tempname"""
ntxt.Close
Set abc = Nothing
或者
Dim s As String, t As String, b() As Byte
s = Join([transpose(char(row(65:75)))], vbCrLf)‘""tempname""
MsgBox s
Open "C:\Users\Administrator\Desktop\新建文本文档 (2).txt" For Binary As #1
ReDim b(LOF(1))
Get #1, , b
s = s & vbCrLf & StrConv(b, vbUnicode)
Put #1, 1, s
Close #1
Shell "notepad.exe C:\Users\Administrator\Desktop\新建文本文档 (2).txt", vbNormalFocus
//写入数据原来数据会没有
Open "C:\Users\Administrator\Desktop\新建文本文档 (2).txt" For Output As #1
strSQL = """tempname"""
Print #1, strSQL
Close #1
原文地址:https://www.cnblogs.com/bignine/p/10091019.html
时间: 2024-10-12 10:30:49