概述
Sub StreamWrite(path, st)
Dim stm
Set stm = CreateObject("Adodb.Stream")
stm.Type = 2
stm.Mode = 3
stm.Charset = "UTF-8"
stm.Open
stm.WriteText = st
stm.SaveToFile (path), 2 '1.不覆盖;2.覆盖
Set stm = Nothing
End Sub
Function StreamRead(path)
Dim stm
Set stm = CreateObject("Adodb.Stream")
stm.Type = 2
stm.Mode = 3
stm.Charset = "UTF-8"
stm.Open
stm.LoadFromFile (path)
StreamRead = stm.ReadText()
Set stm = Nothing
End Function
参考自:http://blog.csdn.net/icanlove/article/details/39394701
最后
以上就是烂漫烤鸡为你收集整理的【VBA自学笔记(三)】StreamWrite与StreamRead——UTF-8的读写的全部内容,希望文章能够帮你解决【VBA自学笔记(三)】StreamWrite与StreamRead——UTF-8的读写所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复