想通过点击硬盘里任意某个文本文件的文件名,可以直接将想把这文本文件打开显示到Text1里
如何在TEXT里显示打开的文本呢?
Private Sub File1_Click()
Dim SelectedFile As TextBox
SelectedFile = File1.Path & "\" & File1.FileName
Text1.Text = Text(SelectedFile)
End Sub
请代我修改下!谢谢!
有高手提供答案如下:
Private Sub File1_Click() Dim aStr As String Open File1.Path & "\" & File1.FileName For Input As #1 While Not EOF(1) Line Input #1, aStr Text1.Text = Text1.Text + aStr + vbCrLf Wend End Sub
但执行时出现:执行时出现提示框:
实时错误“76”
路径未找到 !昨天 16:53:42