Вопрос: Вызов функции ShellExecute, имеет больше возможностей для запуска программ, чем Shell в Access
Совет:
Declare Function apiShellExecute 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" () As Long
Public Const SW_NORMAL = 1
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOWDEFAULT = 10
Public Const SW_SHOWNOACTIVATE = 4
Public Const SW_SHOWNORMAL = 1
lResult = apiShellExecute(frmSplash.hwnd, vbNullString, "TEST.XLS",_
vbnullstring, App.Path, SW_SHOWMAXIMIZED)
lResult = apiShellExecute(GetDesktopWindow(), "open", "http://www.arimsoft.ru"_
, "", 0&, SW_SHOWMAXIMIZED)
Where
frmSplash.hwnd is the calling form's handle
the second param indicates to open the file (you can use "Open" or "Print" as well)
the third is the file name to open
the next is to show I'm not passing any parameters
Then there's the default directory to use
And finally to maiximize it (value 3)
|