MyHelp.chm ????

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how can i make a "MyHelp.chm" whats the format?
an exemple will help a lot
thanks in advance
 
M icrosoft do a Help Workshop that facilitates this. Do a search on their
site.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Microsoft do two programmes which you can get for free. Can't find a
url, but go to microsoft and search for either HTML help workshop o
Help workshop where you can download for free.

I find the HTML version easier to use, and more friendly for end users
but i don't know how to link thr help file to the programme you ar
working with i.e. so that when you press F1, your help file displays
:rolleyes
 
That's easy, I can give the code if he needs it.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
That's easy, I can give the code if he needs it.

If you mean linking F1 and/or WhatsThisHelp to .chm it's certainly not easy
for me!

Tried methods that might work in some setups but fail in others, no doubt me
getting it wrong.

Read a link once about mapping to an "invisible" .hlp file that in turn
links to .chm, which I've been meaning to look into if I can find that link
again.

Any pointers gratefully received.

Regards,
Peter
 
To create an HTML help file:
1) Download Microsoft HTML Help Workshop
2) Look at http://www.developerfusion.com/scripts/print.aspx?id=39 for
step by step instructions on how to use HTML Help Workshop
3) Look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/vsconDesign.asp
for useful tips on designing a help system.

You can also use HTML Help Workshop to decompile .chm files to give
you insight into how things are put together. If you have a large
project you might want to consider purchasing commercial HTML Help
development software - it will make some of the steps less tedious.

Dave
 
Peter,

First off you need to add context ids to the help file.

Then this code can be used to invoke the help file. I tend to use HTML help
with add-ins, so I store the .chm file with the .xla file. Thus I can use
Thisworkbook.Path & "\" & AppTitleId & ".chm"
as the file path, where AppTitleId is a constant value for the application.



Option Explicit


Declare Function HtmlHelp Lib "hhctrl.ocx" _
Alias "HtmlHelpA" _
(ByVal hWnd As Long, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByVal dwData As Long) As Long

Const HH_DISPLAY_TOPIC = &H0
Const HH_SET_WIN_TYPE = &H4
Const HH_GET_WIN_TYPE = &H5
Const HH_GET_WIN_HANDLE = &H6
Const HH_DISPLAY_TEXT_POPUP = &HE ' Display string resource ID or text in
a pop-up window.
Const HH_HELP_CONTEXT = &HF ' Display mapped numeric value in
dwData.
Const HH_TP_HELP_CONTEXTMENU = &H10 ' Text pop-up help, similar to
WinHelp's HELP_CONTEXTMENU.
Const HH_TP_HELP_WM_HELP = &H11 ' text pop-up help, similar to WinHelp's
HELP_WM_HELP.


'---------------------------------------------------------------------------
Public Sub OpenHelp(ByVal ContextId As Long)
'---------------------------------------------------------------------------
' Function: Opens the HTML help file
'---------------------------------------------------------------------------

Dim hwndHelp As Long
'The return value is the window handle of the created help window.
Dim hwndHH
hwndHH = HtmlHelp(0, Thisworkbook.Path & "\" & AppTitleId & ".chm",
HH_HELP_CONTEXT, ContextId)
End Sub


You can then open the help file with code like this, whichg uses id 1000 as
it's in itial entry point and default. Specifying another value alolows
jumping in directly.

'---------------------------------------------------------------------------
Public Function CFShowHelp(Optional HelpId As Long = 1000)
'---------------------------------------------------------------------------
' Function: Shows the Help file
'---------------------------------------------------------------------------

OpenHelp HelpId
End Function

You can monitor F1 on a userform with code like

'---------------------------------------------------------------------------
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
'---------------------------------------------------------------------------
If KeyCode = 112 Then 'F1
OpenHelp 1000
End If

End Sub

Just beware of using the sub name OpenHelp for you app. As we found out
recently, lots of other apps use that sub name (it's the obvious one to
use), and it throws up a nasty little bug as the apps conflict.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top