M
Medhat Nasr
Hi all,
I'm trying to manipulate a custom compiled Html Help file (.chm) for my
runtime-Access .adp, the best way possible.
Having done lots of homework in developing time with both Access and Html
Help Workshop, I've come out with this situation:
Using the next code that runs in my Access-runtime .adp by clicking a
hidden command button in the .adp Start-up Form; I could modify the Built-in
Menu Bar of Access run-time replacing its Help control with my custom Help
Pop-up button.
----------------------------------------------------
Sub AddHelpBttn()
On Error GoTo AddHelpBttn_Err
Dim CBarPopCtl As CommandBarControl
Dim PopCtlChild1 As CommandBarControl
Dim PopCtlChild2 As CommandBarControl
' Finding the Built-in Help control in the Menu Bar and then hiding it.
Set CBarPopCtl = CommandBars("Menu Bar").FindControl _
(ID:=30010)
CBarPopCtl.Visible = False
' Adding a parent custom Help Popup Control to the Menu Bar and
' set some properties.
Set CBarPopCtl = CommandBars("Menu Bar").Controls.Add _
(Type:=msoControlPopup)
With CBarPopCtl
.Caption = "Help"
.TooltipText = "Help Options"
.Tag = "DCDHelp" ' For Later Search
End With
' Create the 1st Child of the parent Help Popup Control and set
' some properties.
Set PopCtlChild1 = CBarPopCtl.Controls.Add _
(Type:=msoControlButton)
With PopCtlChild1
.Style = msoButtonIconAndCaption
.Caption = "DCD Pro &Help"
.FaceId = 984
' The following Function uses the Shell function to open the
' DCDProHelp.chm file.
.OnAction = "=Opn_MyHelp()"
.Tag = "DCDHelp1st" ' For Later Search
End With
' Create the 2nd Child of the Popup Control for Context-Sensitive
' Help.
Set PopCtlChild2 = CBarPopCtl.Controls.Add _
(Type:=msoControlButton, ID:=124)
With PopCtlChild2
.Style = msoButtonIconAndCaption
.Caption = "What's &This?"
.FaceId = 124
.Tag = "DCDHelp2nd" ' For Later Search
'.OnAction = "=HelpEntry()" ' *Optional
End With
Exit Sub
AddHelpBttn_Err:
MsgBox "Error " & Err.Number & vbCr & Err.Description
Exit Sub
End Sub
-----------------------------------------------------
With the above code I got a custom Help menu item very much like the Access
Built-in Help button.The user can optionally open the complete custom .chm
file in its own window by clicking the first button of the custom Help popup
control.
As for its Context-Sensitive Help, if the user has the full version of
Access installed, it works as expected showing the Context-Sensitive Help
topics in Access Help window.
For me, this is not so bad as all the links in every shown topic page are
working correctly, in addition to the better looking and flexibility that
the "What is this?" mouse cursor provide, and finally for the availability
of the Access Answer Wizard tab in Navigation pane.
I really can live with this rather than the {F1} macro solution introduced
in this link:
http://support.microsoft.com/?kbid=275117
Unfortunately, with Access run-time, the choice was not mine.
To get rid of the second blank annoying grey window of MS Access Help, I
activated the labeled VBA line in the above "AddHelpBttn" procedure
assigning the Public Function HelpEntry() , introduced in the above link, to
the OnAction Property of the "What is this?" button in my custom Help popup
Menu item.
And, because the mentioned "HelpEntry()" Function doesn't have any reference
to the HelpContextId of Active Form itself, I slightly modified its code
line that specifies the generic context-id :
---------------------------------------------------
FormHelpId = curForm.Form.HelpContextId ' ( instead of zero )
---------------------------------------------------
This way, I could open, the Context-Sensitive Help topic page of the .adp
active Form itself, rather than its active control - provided that - this
Form's active control hasn't got its own Context-Sensitive Help topic mapped
and assigned to its HelpContextId property!
This was not a good approach after all, because each of my .adp Forms should
necessarily have its own Context-Sensitive Help topic and almost each of its
controls should have its own topic.
My question is:
-----------
Trying a way out of this, and maybe to restore the good looking and
flexibility of the "What is this?" button and mouse cursor , I need to know
if there is any possible approach to manipulate the system mouse pointer in
VBA code, so that it can be changed to the "What is this?"-cursor and then
back to its normal state, the same way this can be done within the system
Control Panel ?!
I've chearched everywhere possible for resources on this, but I couldn't
have any conclusion. Could you help me with, referencing some relevant
links.
Thank you all,
Medhat
I'm trying to manipulate a custom compiled Html Help file (.chm) for my
runtime-Access .adp, the best way possible.
Having done lots of homework in developing time with both Access and Html
Help Workshop, I've come out with this situation:
Using the next code that runs in my Access-runtime .adp by clicking a
hidden command button in the .adp Start-up Form; I could modify the Built-in
Menu Bar of Access run-time replacing its Help control with my custom Help
Pop-up button.
----------------------------------------------------
Sub AddHelpBttn()
On Error GoTo AddHelpBttn_Err
Dim CBarPopCtl As CommandBarControl
Dim PopCtlChild1 As CommandBarControl
Dim PopCtlChild2 As CommandBarControl
' Finding the Built-in Help control in the Menu Bar and then hiding it.
Set CBarPopCtl = CommandBars("Menu Bar").FindControl _
(ID:=30010)
CBarPopCtl.Visible = False
' Adding a parent custom Help Popup Control to the Menu Bar and
' set some properties.
Set CBarPopCtl = CommandBars("Menu Bar").Controls.Add _
(Type:=msoControlPopup)
With CBarPopCtl
.Caption = "Help"
.TooltipText = "Help Options"
.Tag = "DCDHelp" ' For Later Search
End With
' Create the 1st Child of the parent Help Popup Control and set
' some properties.
Set PopCtlChild1 = CBarPopCtl.Controls.Add _
(Type:=msoControlButton)
With PopCtlChild1
.Style = msoButtonIconAndCaption
.Caption = "DCD Pro &Help"
.FaceId = 984
' The following Function uses the Shell function to open the
' DCDProHelp.chm file.
.OnAction = "=Opn_MyHelp()"
.Tag = "DCDHelp1st" ' For Later Search
End With
' Create the 2nd Child of the Popup Control for Context-Sensitive
' Help.
Set PopCtlChild2 = CBarPopCtl.Controls.Add _
(Type:=msoControlButton, ID:=124)
With PopCtlChild2
.Style = msoButtonIconAndCaption
.Caption = "What's &This?"
.FaceId = 124
.Tag = "DCDHelp2nd" ' For Later Search
'.OnAction = "=HelpEntry()" ' *Optional
End With
Exit Sub
AddHelpBttn_Err:
MsgBox "Error " & Err.Number & vbCr & Err.Description
Exit Sub
End Sub
-----------------------------------------------------
With the above code I got a custom Help menu item very much like the Access
Built-in Help button.The user can optionally open the complete custom .chm
file in its own window by clicking the first button of the custom Help popup
control.
As for its Context-Sensitive Help, if the user has the full version of
Access installed, it works as expected showing the Context-Sensitive Help
topics in Access Help window.
For me, this is not so bad as all the links in every shown topic page are
working correctly, in addition to the better looking and flexibility that
the "What is this?" mouse cursor provide, and finally for the availability
of the Access Answer Wizard tab in Navigation pane.
I really can live with this rather than the {F1} macro solution introduced
in this link:
http://support.microsoft.com/?kbid=275117
Unfortunately, with Access run-time, the choice was not mine.
To get rid of the second blank annoying grey window of MS Access Help, I
activated the labeled VBA line in the above "AddHelpBttn" procedure
assigning the Public Function HelpEntry() , introduced in the above link, to
the OnAction Property of the "What is this?" button in my custom Help popup
Menu item.
And, because the mentioned "HelpEntry()" Function doesn't have any reference
to the HelpContextId of Active Form itself, I slightly modified its code
line that specifies the generic context-id :
---------------------------------------------------
FormHelpId = curForm.Form.HelpContextId ' ( instead of zero )
---------------------------------------------------
This way, I could open, the Context-Sensitive Help topic page of the .adp
active Form itself, rather than its active control - provided that - this
Form's active control hasn't got its own Context-Sensitive Help topic mapped
and assigned to its HelpContextId property!
This was not a good approach after all, because each of my .adp Forms should
necessarily have its own Context-Sensitive Help topic and almost each of its
controls should have its own topic.
My question is:
-----------
Trying a way out of this, and maybe to restore the good looking and
flexibility of the "What is this?" button and mouse cursor , I need to know
if there is any possible approach to manipulate the system mouse pointer in
VBA code, so that it can be changed to the "What is this?"-cursor and then
back to its normal state, the same way this can be done within the system
Control Panel ?!
I've chearched everywhere possible for resources on this, but I couldn't
have any conclusion. Could you help me with, referencing some relevant
links.
Thank you all,
Medhat