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 ShellExecute 0, "open", 文件名, vbNullString, vbNullString, 3
Private Sub Form_Load()
WinExec "xxx.doc", 10 WinExec "xxx.bmp", 10 WinExec "xxx.dwg", 10End Sub
Private Sub Form_Load()
WinExec "xxx.doc", 10 WinExec "xxx.bmp", 10 WinExec "xxx.dwg", 10End Sub
Shell ("C:\Program Files\Microsoft Office\Office\winword d:\d.doc")
怎么没有反应?to : zyl910(910:分儿,我来了!) (L2002)
打开了,但是为什么,打开了bmp文件,就不能打开word文件??
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 Me.hwnd, "Open", "C:\aa.doc", "", App.Path, 1
End SubPrivate Sub Command2_Click()
ShellExecute Me.hwnd, "Open", "C:\aa.bmp", "", App.Path, 1
End SubPrivate Sub Command3_Click()
ShellExecute Me.hwnd, "Open", "C:\aa.csv", "", App.Path, 1
End Sub'或不用api
Private Sub Command1_Click()
Shell "Start.exe C:\aa.doc", 1
End SubPrivate Sub Command2_Click()
Shell "Start.exe C:\aa.bmp", 1
End SubPrivate Sub Command3_Click()
Shell "Start.exe C:\aa.csv", 1
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 Me.hwnd, "Open", "C:\aa.doc", "", App.Path, 1
End SubPrivate Sub Command2_Click()
ShellExecute Me.hwnd, "Open", "C:\aa.bmp", "", App.Path, 1
End Sub
'.....'或不用api
Private Sub Command1_Click()
Shell "Start.exe C:\aa.doc", 1
End Sub'......