首先用
CommonDialog1.ShowOpen
选中你需要的那个txt文件
然后用
CommonDialog1.FileName
得到路径以及文件名
就可以打开文件处理了
下面的代码供参考
Dim temp As String
Dim all As String
CommonDialog1.ShowOpen
Open CommonDialog1.FileName For Input As #1
Do While Not EOF(1)
Input #1, temp
all = all & temp & Chr(13) & Chr(10)
Loop
Close #1
Text1.Text = all
温馨提示:答案为网友推荐,仅供参考