Au secours RAYMOND !! PB aide personnalisée en CHM
4 réponses
bastien_bonnarme
bonjour,
dans ma base de données je souhaiterais réaliser une petite aide
personnalisée: j'ai réalisé un autokeys (F1)avec le nom de focntion
=HelpEntry() et trouvé le code suivant sur le site de microsoft pour
apperler le fichier qui est dans le meme repertoire que la base
(aide.chm):
Option Compare Database
Option Explicit
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_Help(HelpFileName As String, MycontextID As Long)
'A specific topic identified by the variable context-ID is started
in
'response to this button click.
Dim hwndHelp As Long
'The return value is the window handle of the created Help window.
Select Case MycontextID
Case Is = 0
hwndHelp = HtmlHelp(Application.hWndAccessApp,
HelpFileName, _
HH_DISPLAY_TOPIC, MycontextID)
Case Else
hwndHelp = HtmlHelp(Application.hWndAccessApp,
HelpFileName, _
HH_HELP_CONTEXT, MycontextID)
End Select
End Sub
Public Function HelpEntry()
'Identify the name of the Help file and a possible context-id.
Dim FormHelpId As Long
Dim FormHelpFile As String
Dim curForm As Form
'Set the curForm variable to the currently active form.
Set curForm = Screen.ActiveForm
'As a default, specify a generic Help file and context-id. Note
that
'the location of your file may be different.
FormHelpFile = "C:\MyProject.chm"
FormHelpId = 1001
'Check the Help file property of the form. If a Help file exists,
'assign the name and context-id to the respective variables.
If curForm.HelpFile <> "" Then
FormHelpFile = curForm.HelpFile
End If
'If the Help context-id of the control is not null and greater
than
'zero, assign the value to the variable.
If Not IsNull(curForm.ActiveControl.Properties("HelpcontextId"))
Then
If curForm.ActiveControl.Properties("HelpcontextId") > 0 Then
FormHelpId =
curForm.ActiveControl.Properties("HelpcontextId")
End If
End If
'Call the function to start the Help file, passing it the name of
the
'Help file and context-id.
Show_Help FormHelpFile, FormHelpId
End Function
mon probleme est donc le suivant: je suis débutant et ne sais pas
comment exploiter le code (ce kil fo remplacé) pourriez -vous
m'éclairer svp ?? cela fait 3 jours que je rame, il parraît que les
vacances c fait pour se reposer....
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Raymond [mvp]
Bonsoir.
Elle fonctionne très bien cette procédure. créer macro autokeys nom de macro: {F1} action : ExécuterCode nom fonction : HelpEntry () pas de signe modifier le nom du fichier chm dans la procédure
FormHelpFile = "aide.chm" FormHelpId = 0
-- @+ Raymond Access MVP http://OfficeSystem.Access.free.fr/ http://OfficeSystem.Access.free.fr/runtime/ http://users.skynet.be/mpfa/ pour débuter sur le forum
"bastos" a écrit dans le message de news:
bonjour, dans ma base de données je souhaiterais réaliser une petite aide personnalisée: j'ai réalisé un autokeys (F1)avec le nom de focntion =HelpEntry() et trouvé le code suivant sur le site de microsoft pour apperler le fichier qui est dans le meme repertoire que la base (aide.chm):
Option Compare Database Option Explicit
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_Help(HelpFileName As String, MycontextID As Long) 'A specific topic identified by the variable context-ID is started in 'response to this button click. Dim hwndHelp As Long
'The return value is the window handle of the created Help window. Select Case MycontextID Case Is = 0 hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _ HH_DISPLAY_TOPIC, MycontextID) Case Else hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _ HH_HELP_CONTEXT, MycontextID) End Select End Sub
Public Function HelpEntry() 'Identify the name of the Help file and a possible context-id. Dim FormHelpId As Long Dim FormHelpFile As String Dim curForm As Form
'Set the curForm variable to the currently active form. Set curForm = Screen.ActiveForm
'As a default, specify a generic Help file and context-id. Note that 'the location of your file may be different. FormHelpFile = "C:MyProject.chm" FormHelpId = 1001
'Check the Help file property of the form. If a Help file exists, 'assign the name and context-id to the respective variables. If curForm.HelpFile <> "" Then FormHelpFile = curForm.HelpFile End If
'If the Help context-id of the control is not null and greater than 'zero, assign the value to the variable. If Not IsNull(curForm.ActiveControl.Properties("HelpcontextId")) Then If curForm.ActiveControl.Properties("HelpcontextId") > 0 Then FormHelpId > curForm.ActiveControl.Properties("HelpcontextId") End If End If
'Call the function to start the Help file, passing it the name of the 'Help file and context-id. Show_Help FormHelpFile, FormHelpId End Function
mon probleme est donc le suivant: je suis débutant et ne sais pas comment exploiter le code (ce kil fo remplacé) pourriez -vous m'éclairer svp ?? cela fait 3 jours que je rame, il parraît que les vacances c fait pour se reposer....
merci beaucoup par avance....
bastien
Bonsoir.
Elle fonctionne très bien cette procédure.
créer macro autokeys
nom de macro: {F1}
action : ExécuterCode
nom fonction : HelpEntry ()
pas de signe
modifier le nom du fichier chm dans la procédure
FormHelpFile = "aide.chm"
FormHelpId = 0
--
@+
Raymond Access MVP
http://OfficeSystem.Access.free.fr/
http://OfficeSystem.Access.free.fr/runtime/
http://users.skynet.be/mpfa/ pour débuter sur le forum
"bastos" <bastien_bonnarme@hotmail.com> a écrit dans le message de news:
fbc79ada.0502241234.3616c71e@posting.google.com...
bonjour,
dans ma base de données je souhaiterais réaliser une petite aide
personnalisée: j'ai réalisé un autokeys (F1)avec le nom de focntion
=HelpEntry() et trouvé le code suivant sur le site de microsoft pour
apperler le fichier qui est dans le meme repertoire que la base
(aide.chm):
Option Compare Database
Option Explicit
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_Help(HelpFileName As String, MycontextID As Long)
'A specific topic identified by the variable context-ID is started
in
'response to this button click.
Dim hwndHelp As Long
'The return value is the window handle of the created Help window.
Select Case MycontextID
Case Is = 0
hwndHelp = HtmlHelp(Application.hWndAccessApp,
HelpFileName, _
HH_DISPLAY_TOPIC, MycontextID)
Case Else
hwndHelp = HtmlHelp(Application.hWndAccessApp,
HelpFileName, _
HH_HELP_CONTEXT, MycontextID)
End Select
End Sub
Public Function HelpEntry()
'Identify the name of the Help file and a possible context-id.
Dim FormHelpId As Long
Dim FormHelpFile As String
Dim curForm As Form
'Set the curForm variable to the currently active form.
Set curForm = Screen.ActiveForm
'As a default, specify a generic Help file and context-id. Note
that
'the location of your file may be different.
FormHelpFile = "C:MyProject.chm"
FormHelpId = 1001
'Check the Help file property of the form. If a Help file exists,
'assign the name and context-id to the respective variables.
If curForm.HelpFile <> "" Then
FormHelpFile = curForm.HelpFile
End If
'If the Help context-id of the control is not null and greater
than
'zero, assign the value to the variable.
If Not IsNull(curForm.ActiveControl.Properties("HelpcontextId"))
Then
If curForm.ActiveControl.Properties("HelpcontextId") > 0 Then
FormHelpId > curForm.ActiveControl.Properties("HelpcontextId")
End If
End If
'Call the function to start the Help file, passing it the name of
the
'Help file and context-id.
Show_Help FormHelpFile, FormHelpId
End Function
mon probleme est donc le suivant: je suis débutant et ne sais pas
comment exploiter le code (ce kil fo remplacé) pourriez -vous
m'éclairer svp ?? cela fait 3 jours que je rame, il parraît que les
vacances c fait pour se reposer....
Elle fonctionne très bien cette procédure. créer macro autokeys nom de macro: {F1} action : ExécuterCode nom fonction : HelpEntry () pas de signe modifier le nom du fichier chm dans la procédure
FormHelpFile = "aide.chm" FormHelpId = 0
-- @+ Raymond Access MVP http://OfficeSystem.Access.free.fr/ http://OfficeSystem.Access.free.fr/runtime/ http://users.skynet.be/mpfa/ pour débuter sur le forum
"bastos" a écrit dans le message de news:
bonjour, dans ma base de données je souhaiterais réaliser une petite aide personnalisée: j'ai réalisé un autokeys (F1)avec le nom de focntion =HelpEntry() et trouvé le code suivant sur le site de microsoft pour apperler le fichier qui est dans le meme repertoire que la base (aide.chm):
Option Compare Database Option Explicit
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_Help(HelpFileName As String, MycontextID As Long) 'A specific topic identified by the variable context-ID is started in 'response to this button click. Dim hwndHelp As Long
'The return value is the window handle of the created Help window. Select Case MycontextID Case Is = 0 hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _ HH_DISPLAY_TOPIC, MycontextID) Case Else hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _ HH_HELP_CONTEXT, MycontextID) End Select End Sub
Public Function HelpEntry() 'Identify the name of the Help file and a possible context-id. Dim FormHelpId As Long Dim FormHelpFile As String Dim curForm As Form
'Set the curForm variable to the currently active form. Set curForm = Screen.ActiveForm
'As a default, specify a generic Help file and context-id. Note that 'the location of your file may be different. FormHelpFile = "C:MyProject.chm" FormHelpId = 1001
'Check the Help file property of the form. If a Help file exists, 'assign the name and context-id to the respective variables. If curForm.HelpFile <> "" Then FormHelpFile = curForm.HelpFile End If
'If the Help context-id of the control is not null and greater than 'zero, assign the value to the variable. If Not IsNull(curForm.ActiveControl.Properties("HelpcontextId")) Then If curForm.ActiveControl.Properties("HelpcontextId") > 0 Then FormHelpId > curForm.ActiveControl.Properties("HelpcontextId") End If End If
'Call the function to start the Help file, passing it the name of the 'Help file and context-id. Show_Help FormHelpFile, FormHelpId End Function
mon probleme est donc le suivant: je suis débutant et ne sais pas comment exploiter le code (ce kil fo remplacé) pourriez -vous m'éclairer svp ?? cela fait 3 jours que je rame, il parraît que les vacances c fait pour se reposer....
merci beaucoup par avance....
bastien
Codial
Bonsoir,
oui cool elle fonctionne très bien cette procédure. C'est ce que je recherchais depuis un moment et je viens juste de la tester! il faut mettre HelpEntry dans le formulaire qui appelle pour transmettre le ContextID ou bien la modifier pour la mettre dans un module
Merci bastos
Amicalement
Codial
"Raymond [mvp]" a écrit dans le message de news: %
Bonsoir.
Elle fonctionne très bien cette procédure. créer macro autokeys nom de macro: {F1} action : ExécuterCode nom fonction : HelpEntry () pas de signe > modifier le nom du fichier chm dans la procédure
FormHelpFile = "aide.chm" FormHelpId = 0
-- @+ Raymond Access MVP http://OfficeSystem.Access.free.fr/ http://OfficeSystem.Access.free.fr/runtime/ http://users.skynet.be/mpfa/ pour débuter sur le forum
"bastos" a écrit dans le message de news:
bonjour, dans ma base de données je souhaiterais réaliser une petite aide personnalisée: j'ai réalisé un autokeys (F1)avec le nom de focntion =HelpEntry() et trouvé le code suivant sur le site de microsoft pour apperler le fichier qui est dans le meme repertoire que la base (aide.chm):
Option Compare Database Option Explicit
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_Help(HelpFileName As String, MycontextID As Long) 'A specific topic identified by the variable context-ID is started in 'response to this button click. Dim hwndHelp As Long
'The return value is the window handle of the created Help window. Select Case MycontextID Case Is = 0 hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _ HH_DISPLAY_TOPIC, MycontextID) Case Else hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _ HH_HELP_CONTEXT, MycontextID) End Select End Sub
Public Function HelpEntry() 'Identify the name of the Help file and a possible context-id. Dim FormHelpId As Long Dim FormHelpFile As String Dim curForm As Form
'Set the curForm variable to the currently active form. Set curForm = Screen.ActiveForm
'As a default, specify a generic Help file and context-id. Note that 'the location of your file may be different. FormHelpFile = "C:MyProject.chm" FormHelpId = 1001
'Check the Help file property of the form. If a Help file exists, 'assign the name and context-id to the respective variables. If curForm.HelpFile <> "" Then FormHelpFile = curForm.HelpFile End If
'If the Help context-id of the control is not null and greater than 'zero, assign the value to the variable. If Not IsNull(curForm.ActiveControl.Properties("HelpcontextId")) Then If curForm.ActiveControl.Properties("HelpcontextId") > 0 Then FormHelpId >> curForm.ActiveControl.Properties("HelpcontextId") End If End If
'Call the function to start the Help file, passing it the name of the 'Help file and context-id. Show_Help FormHelpFile, FormHelpId End Function
mon probleme est donc le suivant: je suis débutant et ne sais pas comment exploiter le code (ce kil fo remplacé) pourriez -vous m'éclairer svp ?? cela fait 3 jours que je rame, il parraît que les vacances c fait pour se reposer....
merci beaucoup par avance....
bastien
Bonsoir,
oui cool elle fonctionne très bien cette procédure. C'est ce que je
recherchais depuis un moment et je viens juste de la tester!
il faut mettre HelpEntry dans le formulaire qui appelle pour transmettre le
ContextID ou bien la modifier pour la mettre dans un module
Merci bastos
Amicalement
Codial
"Raymond [mvp]" <XYZ.officesystem.access@free.fr> a écrit dans le message de
news: %23L0EqgrGFHA.1392@TK2MSFTNGP10.phx.gbl...
Bonsoir.
Elle fonctionne très bien cette procédure.
créer macro autokeys
nom de macro: {F1}
action : ExécuterCode
nom fonction : HelpEntry ()
pas de signe >
modifier le nom du fichier chm dans la procédure
FormHelpFile = "aide.chm"
FormHelpId = 0
--
@+
Raymond Access MVP
http://OfficeSystem.Access.free.fr/
http://OfficeSystem.Access.free.fr/runtime/
http://users.skynet.be/mpfa/ pour débuter sur le forum
"bastos" <bastien_bonnarme@hotmail.com> a écrit dans le message de news:
fbc79ada.0502241234.3616c71e@posting.google.com...
bonjour,
dans ma base de données je souhaiterais réaliser une petite aide
personnalisée: j'ai réalisé un autokeys (F1)avec le nom de focntion
=HelpEntry() et trouvé le code suivant sur le site de microsoft pour
apperler le fichier qui est dans le meme repertoire que la base
(aide.chm):
Option Compare Database
Option Explicit
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_Help(HelpFileName As String, MycontextID As Long)
'A specific topic identified by the variable context-ID is started
in
'response to this button click.
Dim hwndHelp As Long
'The return value is the window handle of the created Help window.
Select Case MycontextID
Case Is = 0
hwndHelp = HtmlHelp(Application.hWndAccessApp,
HelpFileName, _
HH_DISPLAY_TOPIC, MycontextID)
Case Else
hwndHelp = HtmlHelp(Application.hWndAccessApp,
HelpFileName, _
HH_HELP_CONTEXT, MycontextID)
End Select
End Sub
Public Function HelpEntry()
'Identify the name of the Help file and a possible context-id.
Dim FormHelpId As Long
Dim FormHelpFile As String
Dim curForm As Form
'Set the curForm variable to the currently active form.
Set curForm = Screen.ActiveForm
'As a default, specify a generic Help file and context-id. Note
that
'the location of your file may be different.
FormHelpFile = "C:MyProject.chm"
FormHelpId = 1001
'Check the Help file property of the form. If a Help file exists,
'assign the name and context-id to the respective variables.
If curForm.HelpFile <> "" Then
FormHelpFile = curForm.HelpFile
End If
'If the Help context-id of the control is not null and greater
than
'zero, assign the value to the variable.
If Not IsNull(curForm.ActiveControl.Properties("HelpcontextId"))
Then
If curForm.ActiveControl.Properties("HelpcontextId") > 0 Then
FormHelpId >> curForm.ActiveControl.Properties("HelpcontextId")
End If
End If
'Call the function to start the Help file, passing it the name of
the
'Help file and context-id.
Show_Help FormHelpFile, FormHelpId
End Function
mon probleme est donc le suivant: je suis débutant et ne sais pas
comment exploiter le code (ce kil fo remplacé) pourriez -vous
m'éclairer svp ?? cela fait 3 jours que je rame, il parraît que les
vacances c fait pour se reposer....
oui cool elle fonctionne très bien cette procédure. C'est ce que je recherchais depuis un moment et je viens juste de la tester! il faut mettre HelpEntry dans le formulaire qui appelle pour transmettre le ContextID ou bien la modifier pour la mettre dans un module
Merci bastos
Amicalement
Codial
"Raymond [mvp]" a écrit dans le message de news: %
Bonsoir.
Elle fonctionne très bien cette procédure. créer macro autokeys nom de macro: {F1} action : ExécuterCode nom fonction : HelpEntry () pas de signe > modifier le nom du fichier chm dans la procédure
FormHelpFile = "aide.chm" FormHelpId = 0
-- @+ Raymond Access MVP http://OfficeSystem.Access.free.fr/ http://OfficeSystem.Access.free.fr/runtime/ http://users.skynet.be/mpfa/ pour débuter sur le forum
"bastos" a écrit dans le message de news:
bonjour, dans ma base de données je souhaiterais réaliser une petite aide personnalisée: j'ai réalisé un autokeys (F1)avec le nom de focntion =HelpEntry() et trouvé le code suivant sur le site de microsoft pour apperler le fichier qui est dans le meme repertoire que la base (aide.chm):
Option Compare Database Option Explicit
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_Help(HelpFileName As String, MycontextID As Long) 'A specific topic identified by the variable context-ID is started in 'response to this button click. Dim hwndHelp As Long
'The return value is the window handle of the created Help window. Select Case MycontextID Case Is = 0 hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _ HH_DISPLAY_TOPIC, MycontextID) Case Else hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _ HH_HELP_CONTEXT, MycontextID) End Select End Sub
Public Function HelpEntry() 'Identify the name of the Help file and a possible context-id. Dim FormHelpId As Long Dim FormHelpFile As String Dim curForm As Form
'Set the curForm variable to the currently active form. Set curForm = Screen.ActiveForm
'As a default, specify a generic Help file and context-id. Note that 'the location of your file may be different. FormHelpFile = "C:MyProject.chm" FormHelpId = 1001
'Check the Help file property of the form. If a Help file exists, 'assign the name and context-id to the respective variables. If curForm.HelpFile <> "" Then FormHelpFile = curForm.HelpFile End If
'If the Help context-id of the control is not null and greater than 'zero, assign the value to the variable. If Not IsNull(curForm.ActiveControl.Properties("HelpcontextId")) Then If curForm.ActiveControl.Properties("HelpcontextId") > 0 Then FormHelpId >> curForm.ActiveControl.Properties("HelpcontextId") End If End If
'Call the function to start the Help file, passing it the name of the 'Help file and context-id. Show_Help FormHelpFile, FormHelpId End Function
mon probleme est donc le suivant: je suis débutant et ne sais pas comment exploiter le code (ce kil fo remplacé) pourriez -vous m'éclairer svp ?? cela fait 3 jours que je rame, il parraît que les vacances c fait pour se reposer....
merci beaucoup par avance....
bastien
Codial
Bonsoir,
j'ai modifié la fonction pour la mettre dans un module et lui transmettre le ContextID en cours et ça à l'air de marcher!!
Public Function HelpEntry(IDContext As Integer) 'Identify the name of the Help file and a possible context-id. Dim FormHelpId As Long Dim FormHelpFile As String Dim curForm As Form
'Set the curForm variable to the currently active form. Set curForm = Screen.ActiveForm
'As a default, specify a generic Help file and context-id. Note that 'the location of your file may be different. FormHelpFile = CurrentDBDir & "ref_mat.chm" FormHelpId = IDContext Amicalement Codial
"bastos" a écrit dans le message de news:
bonjour, dans ma base de données je souhaiterais réaliser une petite aide personnalisée: j'ai réalisé un autokeys (F1)avec le nom de focntion =HelpEntry() et trouvé le code suivant sur le site de microsoft pour apperler le fichier qui est dans le meme repertoire que la base (aide.chm):
Option Compare Database Option Explicit
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_Help(HelpFileName As String, MycontextID As Long) 'A specific topic identified by the variable context-ID is started in 'response to this button click. Dim hwndHelp As Long
'The return value is the window handle of the created Help window. Select Case MycontextID Case Is = 0 hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _ HH_DISPLAY_TOPIC, MycontextID) Case Else hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _ HH_HELP_CONTEXT, MycontextID) End Select End Sub
Public Function HelpEntry() 'Identify the name of the Help file and a possible context-id. Dim FormHelpId As Long Dim FormHelpFile As String Dim curForm As Form
'Set the curForm variable to the currently active form. Set curForm = Screen.ActiveForm
'As a default, specify a generic Help file and context-id. Note that 'the location of your file may be different. FormHelpFile = "C:MyProject.chm" FormHelpId = 1001
'Check the Help file property of the form. If a Help file exists, 'assign the name and context-id to the respective variables. If curForm.HelpFile <> "" Then FormHelpFile = curForm.HelpFile End If
'If the Help context-id of the control is not null and greater than 'zero, assign the value to the variable. If Not IsNull(curForm.ActiveControl.Properties("HelpcontextId")) Then If curForm.ActiveControl.Properties("HelpcontextId") > 0 Then FormHelpId > curForm.ActiveControl.Properties("HelpcontextId") End If End If
'Call the function to start the Help file, passing it the name of the 'Help file and context-id. Show_Help FormHelpFile, FormHelpId End Function
mon probleme est donc le suivant: je suis débutant et ne sais pas comment exploiter le code (ce kil fo remplacé) pourriez -vous m'éclairer svp ?? cela fait 3 jours que je rame, il parraît que les vacances c fait pour se reposer....
merci beaucoup par avance....
bastien
Bonsoir,
j'ai modifié la fonction pour la mettre dans un module et lui transmettre le
ContextID en cours et ça à l'air de marcher!!
Public Function HelpEntry(IDContext As Integer)
'Identify the name of the Help file and a possible context-id.
Dim FormHelpId As Long
Dim FormHelpFile As String
Dim curForm As Form
'Set the curForm variable to the currently active form.
Set curForm = Screen.ActiveForm
'As a default, specify a generic Help file and context-id. Note that
'the location of your file may be different.
FormHelpFile = CurrentDBDir & "ref_mat.chm"
FormHelpId = IDContext
Amicalement
Codial
"bastos" <bastien_bonnarme@hotmail.com> a écrit dans le message de news:
fbc79ada.0502241234.3616c71e@posting.google.com...
bonjour,
dans ma base de données je souhaiterais réaliser une petite aide
personnalisée: j'ai réalisé un autokeys (F1)avec le nom de focntion
=HelpEntry() et trouvé le code suivant sur le site de microsoft pour
apperler le fichier qui est dans le meme repertoire que la base
(aide.chm):
Option Compare Database
Option Explicit
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_Help(HelpFileName As String, MycontextID As Long)
'A specific topic identified by the variable context-ID is started
in
'response to this button click.
Dim hwndHelp As Long
'The return value is the window handle of the created Help window.
Select Case MycontextID
Case Is = 0
hwndHelp = HtmlHelp(Application.hWndAccessApp,
HelpFileName, _
HH_DISPLAY_TOPIC, MycontextID)
Case Else
hwndHelp = HtmlHelp(Application.hWndAccessApp,
HelpFileName, _
HH_HELP_CONTEXT, MycontextID)
End Select
End Sub
Public Function HelpEntry()
'Identify the name of the Help file and a possible context-id.
Dim FormHelpId As Long
Dim FormHelpFile As String
Dim curForm As Form
'Set the curForm variable to the currently active form.
Set curForm = Screen.ActiveForm
'As a default, specify a generic Help file and context-id. Note
that
'the location of your file may be different.
FormHelpFile = "C:MyProject.chm"
FormHelpId = 1001
'Check the Help file property of the form. If a Help file exists,
'assign the name and context-id to the respective variables.
If curForm.HelpFile <> "" Then
FormHelpFile = curForm.HelpFile
End If
'If the Help context-id of the control is not null and greater
than
'zero, assign the value to the variable.
If Not IsNull(curForm.ActiveControl.Properties("HelpcontextId"))
Then
If curForm.ActiveControl.Properties("HelpcontextId") > 0 Then
FormHelpId > curForm.ActiveControl.Properties("HelpcontextId")
End If
End If
'Call the function to start the Help file, passing it the name of
the
'Help file and context-id.
Show_Help FormHelpFile, FormHelpId
End Function
mon probleme est donc le suivant: je suis débutant et ne sais pas
comment exploiter le code (ce kil fo remplacé) pourriez -vous
m'éclairer svp ?? cela fait 3 jours que je rame, il parraît que les
vacances c fait pour se reposer....
j'ai modifié la fonction pour la mettre dans un module et lui transmettre le ContextID en cours et ça à l'air de marcher!!
Public Function HelpEntry(IDContext As Integer) 'Identify the name of the Help file and a possible context-id. Dim FormHelpId As Long Dim FormHelpFile As String Dim curForm As Form
'Set the curForm variable to the currently active form. Set curForm = Screen.ActiveForm
'As a default, specify a generic Help file and context-id. Note that 'the location of your file may be different. FormHelpFile = CurrentDBDir & "ref_mat.chm" FormHelpId = IDContext Amicalement Codial
"bastos" a écrit dans le message de news:
bonjour, dans ma base de données je souhaiterais réaliser une petite aide personnalisée: j'ai réalisé un autokeys (F1)avec le nom de focntion =HelpEntry() et trouvé le code suivant sur le site de microsoft pour apperler le fichier qui est dans le meme repertoire que la base (aide.chm):
Option Compare Database Option Explicit
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_Help(HelpFileName As String, MycontextID As Long) 'A specific topic identified by the variable context-ID is started in 'response to this button click. Dim hwndHelp As Long
'The return value is the window handle of the created Help window. Select Case MycontextID Case Is = 0 hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _ HH_DISPLAY_TOPIC, MycontextID) Case Else hwndHelp = HtmlHelp(Application.hWndAccessApp, HelpFileName, _ HH_HELP_CONTEXT, MycontextID) End Select End Sub
Public Function HelpEntry() 'Identify the name of the Help file and a possible context-id. Dim FormHelpId As Long Dim FormHelpFile As String Dim curForm As Form
'Set the curForm variable to the currently active form. Set curForm = Screen.ActiveForm
'As a default, specify a generic Help file and context-id. Note that 'the location of your file may be different. FormHelpFile = "C:MyProject.chm" FormHelpId = 1001
'Check the Help file property of the form. If a Help file exists, 'assign the name and context-id to the respective variables. If curForm.HelpFile <> "" Then FormHelpFile = curForm.HelpFile End If
'If the Help context-id of the control is not null and greater than 'zero, assign the value to the variable. If Not IsNull(curForm.ActiveControl.Properties("HelpcontextId")) Then If curForm.ActiveControl.Properties("HelpcontextId") > 0 Then FormHelpId > curForm.ActiveControl.Properties("HelpcontextId") End If End If
'Call the function to start the Help file, passing it the name of the 'Help file and context-id. Show_Help FormHelpFile, FormHelpId End Function
mon probleme est donc le suivant: je suis débutant et ne sais pas comment exploiter le code (ce kil fo remplacé) pourriez -vous m'éclairer svp ?? cela fait 3 jours que je rame, il parraît que les vacances c fait pour se reposer....
merci beaucoup par avance....
bastien
Raymond [mvp]
Tu trouveras la fonction api : aide html à l'adresse: http://officesystem.access.free.fr/apihtmlhelp.htm
-- @+ Raymond Access MVP http://OfficeSystem.Access.free.fr/ http://OfficeSystem.Access.free.fr/runtime/ http://users.skynet.be/mpfa/ pour débuter sur le forum
"Codial" a écrit dans le message de news:
Bonsoir,
oui cool elle fonctionne très bien cette procédure. C'est ce que je recherchais depuis un moment et je viens juste de la tester! il faut mettre HelpEntry dans le formulaire qui appelle pour transmettre le ContextID ou bien la modifier pour la mettre dans un module
Merci bastos
Amicalement
Codial
Tu trouveras la fonction api : aide html à l'adresse:
http://officesystem.access.free.fr/apihtmlhelp.htm
--
@+
Raymond Access MVP
http://OfficeSystem.Access.free.fr/
http://OfficeSystem.Access.free.fr/runtime/
http://users.skynet.be/mpfa/ pour débuter sur le forum
"Codial" <aCodial@tiscali.fr> a écrit dans le message de news:
Olz1InrGFHA.2360@TK2MSFTNGP12.phx.gbl...
Bonsoir,
oui cool elle fonctionne très bien cette procédure. C'est ce que je
recherchais depuis un moment et je viens juste de la tester!
il faut mettre HelpEntry dans le formulaire qui appelle pour transmettre
le ContextID ou bien la modifier pour la mettre dans un module
Tu trouveras la fonction api : aide html à l'adresse: http://officesystem.access.free.fr/apihtmlhelp.htm
-- @+ Raymond Access MVP http://OfficeSystem.Access.free.fr/ http://OfficeSystem.Access.free.fr/runtime/ http://users.skynet.be/mpfa/ pour débuter sur le forum
"Codial" a écrit dans le message de news:
Bonsoir,
oui cool elle fonctionne très bien cette procédure. C'est ce que je recherchais depuis un moment et je viens juste de la tester! il faut mettre HelpEntry dans le formulaire qui appelle pour transmettre le ContextID ou bien la modifier pour la mettre dans un module