Private Sub mnuOpen_Click()
Dim oDLG
Dim b() As Byte, S As String
Set oDLG = CreateObject("MSComDlg.CommonDialog")
With oDLG
.DialogTitle = "打开文件"
.Filter = "文本文件|*.txt"
.MaxFileSize = 255
.ShowOpen
If .FileName <> "" Then
ReDim b(FileLen(.FileName))
Open .FileName For Binary As #1
Get #1, , b
Close #1
Text1.Text = StrConv(b, vbUnicode)
End If
End With
Set oDLG = Nothing
End Sub
温馨提示:答案为网友推荐,仅供参考