The Shell function will only launch an executable although you can usually specify the file as a command line parameter. The ShellExecute API can open or a print a file in its registered application and avoids having to know whether a particular executable exists on the PC or its path.
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_MAXIMIZE = 3 'Maximize the opened window
Const SW_MINIMIZE = 6 'Minimize the opened window
Const SW_SHOWNORMAL = 1 'Show the opened window and activate it (as usual)
Then to open a jpg file, call it as follows:
ShellExecute Me.hwnd, "open", "x:\path\xyz.jpg", _
vbNullString, vbNullString, SW_SHOWNORMAL
Paul Bent
Northwind IT Systems