MS Word VBA to display Unicode strings

早过忘川 提交于 2019-11-28 02:21:19

Lets have an UTF-8 text file unicode.txt, a form UserForm1 with label Label1 and Button CommandButton1:

'ensure reference is set to Microsoft ActiveX DataObjects library 
'(the latest version of it) under "tools/references"

Dim adoStream As ADODB.Stream
Dim var_String As Variant

Set adoStream = New ADODB.Stream

adoStream.Charset = "UTF-8"
adoStream.Open
adoStream.LoadFromFile "unicode.txt"

Label1 = adoStream.ReadText

adoStream.Close
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!