例子如下:
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
Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Long
Dim Scr_hDC As Long
Dim WorkDir As String
Dim r As Long
Scr_hDC = GetDesktopWindow()
WorkDir = "d:\Work"
r = ShellExecute(Scr_hDC, "Open", DocumentName, 0&, WorkDir, 3) |