打开c:\abc.txt文件 Private Sub Command1_Click() x = Shell("c:\pwin98\notepad.exe c:\abc.txt", vbNormalFocus) End Sub
shell "Notepad.exe Filepath\FileName"
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 用这个API最安全.
直接调用API函数
Private Sub Command1_Click()
x = Shell("c:\pwin98\notepad.exe c:\abc.txt", vbNormalFocus)
End Sub
用这个API最安全.