'修改一下楼上的代码Private Sub Command1_Click()On Error GoTo userCanceled With CommonDialog1 .FileName = "" .InitDir = App.Path .CancelError = True .Filter = "文本文件(*.txt)|*.txt" .ShowOpen End With Text1.Text = CommonDialog1.FileTitle '修改此处,不带路径,只显示文件名和后缀名userCanceled:End Sub