'#############################
Private Sub Form_Load()
<other code>
strPath = App.Path & "\User Manual\" 'Path of the Help File
strFileName = "LogIn.htm" 'Name of the Help File
End Sub
'#############################
'############################
Under the option explicit [above code modules:
Option Explicit
Private Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As String, _
ByVal lpDirectory As String, _
ByVal lpResult As String) As Long
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
Private Const SW_SHOWNORMAL = 1
Dim strPath As String 'Path of the help file
Dim strFileName As String 'Help file name (Log In)
'############################
'Private Sub cmdHelp_Click()
Dim strProgramName As String * 255
Dim lngFind As Long
Dim lngShell As Long
lngFind = FindExecutable(strFileName, strPath, strProgramName) 'Select approperiate program to open help file with
Select Case lngFind
Case 0
MsgBox "Not enough memory available. Please close some programs and try again."
Exit Sub
Case 1 To 30
MsgBox "The help file 'LogIn.htm' not fount in the directory" & strPath & _
".", vbOKOnly + vbCritical, "Help file not found"
Exit Sub
Case 31
MsgBox "Unable to find Web Browser."
Exit Sub
Case Is > 31
lngShell = ShellExecute(frmAPHS_SDB.hwnd, "Open", strPath & strFileName, "", "", SW_SHOWNORMAL) 'Open help file
If lngShell > 31 Then
Else
MsgBox "Unable to launch Web Browser."
End If
End Select
End Sub
'#########################