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
|
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
Dossier = CurrentProject.path
If FileExists("Aide.chm", Dossier) = True Then
Dossier = Dossier & "\" & "Aide.chm"
CHelp.Show (Dossier)
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