1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| Option Compare Database
Option Explicit
Private Const HH_DISPLAY_TOPIC = &H0
Private Const HH_HELP_CONTEXT = &HF
Private Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" _
(ByVal hwndCaller As Long, _
ByVal pszFile As String, _
ByVal uCommand As Long, _
ByVal dwData As Long) As Long
Public Sub Show(NewFile As String, Optional WindowPane As String, Optional contextID)
Dim Fichier As String
Fichier = NewFile
If Len(WindowPane) Then
Fichier = Trim(Fichier) & ">" & Trim(WindowPane)
End If
If IsMissing(contextID) Then
Call HtmlHelp(0, Fichier, HH_DISPLAY_TOPIC, ByVal 0&)
Else
Call HtmlHelp(0, Fichier, HH_HELP_CONTEXT, contextID)
End If
End Sub
Public Function AppelAide()
Dim Dossier As String
Dim lgcontext As Long
lngcontext = Screen.ActiveForm.Properties("HelpcontextId")
Dossier = CurrentProject.Path
If FileExists("Aide.chm", "C:\Program Files\gestion SEGPA demo") = True Then
Dossier = "C:\Program Files\gestion SEGPA demo" & "\" & "Aide.chm"
Chelp.Show (Dossier), , lngcontext
Else
MsgBox "le fichier d'aide spécifié n'a pas été trouvé", vbCritical, "Mon application"
End If
End Function
Public Function FileExists(Fichier$, Optional Dossier) As Boolean
With Application.FileSearch
.FileName = Fichier
If IsMissing(Dossier) = False Then
.LookIn = Dossier
Else
.LookIn = CurDir()
End If
.SearchSubFolders = False
.Execute
If .FoundFiles.Count > 0 Then
FileExists = True
Else
FileExists = False
End If
End With
End Function |
Partager