如题!

解决方案 »

  1.   

    Private Sub Command1_Click()
    x = Shell("notepad.exe c:\temp.txt", vbNormalFocus)
    End Sub
      

  2.   

    Shell的第一个参数是指程序名字和参数。二个是运行方式,比如最大化最小化字类的
      

  3.   

    谢谢了!
    你是高手,能不能给留个联系方式,以后让我好向你讨教呢?
    我给你留一个邮箱:[email protected]
    可以和你交个朋友吗?
      

  4.   

    请问我这个是怎么错了?
    Dim FSO As New FileSystemObject
    Dim txtfile As TextStream
    Dim a
    Dim begintimePrivate Sub Command1_Click()  '建立一个文件,并向其中写入内容
     begintime = Now
     Set a = App
     If FSO.FileExists(a.Path & "\temp.txt") Then
      Set txtfile = FSO.OpenTextFile(a.Path & "\temp.txt", ForAppending)
     Else
      Set txtfile = FSO.OpenTextFile(a.Path & "\temp.txt", ForAppending, True)
     End If
     txtfile.WriteLine begintime
     txtfile.WriteLine ("Date for design!")
     txtfile.WriteLine "***********"
     txtfile.Close
    End SubPrivate Sub Command2_Click()  '打开原有的文件
     Dim X
     Set a = App
     X = Shell("notepad.exe" + a + " \temp.txt", vbNormalFocus)
    End Sub为什么会有错误呢?错误提示如下:实时错误'438'
    对象不支持该属性或方法
      

  5.   

    这样写:
    X = Shell("notepad.exe " & "app.path" & "\temp.txt", vbNormalFocus)
      

  6.   

    各位,我都要哭了,还是不行啊!
    还是打不开原来已经存在的文件,我按照huxiangming(老虎)的方法改了,可还是打不开,给出提示:
    系统找不到指定的路径!求你们了!再想想办法,帮帮我!
      

  7.   

    更正:)
    X = Shell("notepad.exe " & App.Path & "\temp.txt", vbNormalFocus)
      

  8.   

    你的temp.txt是不是在你的当前目录下?
    我实验过了,肯定没有问题。
      

  9.   

    还是不行啊,我都按照你所说的运行了,我的这个文件就是在 command1 中建立的呀,然后我就用 command2  来检测是否可以打开,然后系统就提示:
    系统找不到指定的路径!
      

  10.   

    你先在当前目录下建立一个temp.txt先吃准是读,还是写的问题。
      

  11.   

    你写的"\temp.txt"里面有个空格:)
      

  12.   

    哦,多谢谢你了!
    对呀,是我在temp.txt前多写了一个空格!
    :)