在程序中给出路径及文件名 如何通过单击打开按钮 打开该word文件?
请高手指教!小弟不胜感激!多谢!!

解决方案 »

  1.   

    Option Explicit
    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()
        Dim file As String
        file = "c:\123.doc"
        ShellExecute 0, "open", file, vbNullString, vbNullString, 5
    End Sub
      

  2.   

    Set WordApp = New Word.Application
    WordApp.Documents.add   '添加路径
    WordApp.Visible = true
    ................................
    WordApp.Quit False
    Set WordApp = Nothing