添加引用 Microsoft Scripting Runtime
Dim fso As New FileSystemObject
Dim fts As TextStream
Dim fp As String
Dim rst As String
fp = "c:\a.txt"
Set fts = fso.OpenTextFile(fp, ForReading, False, TristateUseDefault)
rst = fts.ReadAll
set fts=Nothing
set fso=Nothing
MsgBox rst
Function ReadTXT(TXTFile As String) As String
Dim FD() As Byte
Open TXTFile For Binary As #1
ReDim FD(1 To LOF(1)) As Byte
Get #1, , FD
Close #1
ReadTXT = StrConv(FD, vbUnicode): Erase FD
End Function