Function SaveTextAsUTF8(filePath, Text)
Const adTypeText = 2
Const adSaveCreateOverWrite = 2
'Create Stream object
Dim TextStream
Set TextStream = CreateObject("ADODB.Stream")
With TextStream
.Open
.CharSet = "UTF-8"
.Position = TextStream.Size
.WriteText Text
.SaveToFile filePath, adSaveCreateOverWrite
.Close
End With
Set TextStream = Nothing
End Function
沒有留言:
張貼留言