EXCEL-VBA:读取UTF-8格式的文本文件

Function ReadUTF8File(ByVal FileName As String) As String  
    With CreateObject("ADODB.Stream")  
        .Type = 2    '读取
        .Mode = 3 '读写模式
        .Open  
        .LoadFromFile FileName  
        .Charset = "UTF-8" '编码格式
        .Position = 2  
        ReadUTF8File = .ReadText  
        .Close  
    End With  
End Function 

 

你可能感兴趣的:(VBA,VB,OFFICE-EXCEL,UTF-8,UTF,文本文件,读取)