标签:creat set object line ODB save pos adt overwrite
Public Sub WriteUTF_8BomNon(ByVal fileName As String, ByVal strLine As String)
Dim stream: Set stream = CreateObject("ADODB.Stream")
stream.Type = 2 ‘ adTypeText
stream.Charset = "UTF-8"
stream.Open
stream.writeText strLine
stream.Position = 0
stream.Type = 1 ‘ adTypeBinary
stream.Position = 3
Dim bin: bin = stream.Read()
stream.Close
Dim restream: Set restream = CreateObject("ADODB.Stream")
restream.Type = 1 ‘ dTypeBinary
restream.Open
restream.Write bin
restream.SaveToFile fileName, 2 ‘ force overwrite
restream.Close
End Sub
标签:creat set object line ODB save pos adt overwrite
原文地址:https://www.cnblogs.com/wzhw2015/p/12355032.html