用ShellExecute打开一个Word文件,ShellExecute可以调用与其相关联的应用程序: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 Long Const SW_SHOWNORMAL = 1 Private Sub Form_Load() ShellExecute Me.hwnd, vbNullString, "c:\aa.doc", vbNullString, "", SW_SHOWNORMAL End Sub
"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 Long
Const SW_SHOWNORMAL = 1
Private Sub Form_Load() ShellExecute Me.hwnd, vbNullString, "c:\aa.doc", vbNullString, "",
SW_SHOWNORMAL
End Sub