用vb中的command 命令按钮能打开一个记事本或world 文档吗?
代码怎么编写啊?

解决方案 »

  1.   

    shell 函数或ShellExecute API函数
      

  2.   

    Private Sub Command1_Click()
        Shell "notepad.exe C:\test.txt", vbMaximizedFocus
    End Sub
    ----------------------------------------
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPrivate Sub Command1_Click()
        ShellExecute hwnd, "Open", "C:\test.doc", "", "", 1
    End Sub
      

  3.   

    我是个初学者,给我两个函数,我笨的还不知道怎么用呢?
    能不能说的更详细一点啊?谢谢。command控件的属性要调节什么吗?
      

  4.   

    不需要,直接用shell函数就行