Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default Addressing a Help File

I am writing a compiled html help file (.chm format) to be used with a
specific workbook. How can I open and read the help file from within
the workbook?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Addressing a Help File

To invoke them, use some code like


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)
Dim hwndHelp As Long
'The return value is the window handle of the created help window.
Dim hwndHH
hwndHH = HtmlHelp(0, ThisWorkbook.Path & "\" & AppId & ".chm",
HH_HELP_CONTEXT, ContextId)
End Sub


where ContextId is defined in the HTML help file creation , and AppId is the
application name (assuming that is used for your help file).



One note, OpenHelp is probably not a good name to use. I had a problem with
one of my addins that conflicted with one of Rob Bovey's, because we both
used that procedure name.


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Alan" wrote in message
ups.com...
I am writing a compiled html help file (.chm format) to be used with a
specific workbook. How can I open and read the help file from within
the workbook?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default Addressing a Help File

Thanks Bob,

I'll have a go and keep you posted.

Alan

Bob Phillips wrote:
To invoke them, use some code like


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)
Dim hwndHelp As Long
'The return value is the window handle of the created help window.
Dim hwndHH
hwndHH = HtmlHelp(0, ThisWorkbook.Path & "\" & AppId & ".chm",
HH_HELP_CONTEXT, ContextId)
End Sub


where ContextId is defined in the HTML help file creation , and AppId is the
application name (assuming that is used for your help file).



One note, OpenHelp is probably not a good name to use. I had a problem with
one of my addins that conflicted with one of Rob Bovey's, because we both
used that procedure name.


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Alan" wrote in message
ups.com...
I am writing a compiled html help file (.chm format) to be used with a
specific workbook. How can I open and read the help file from within
the workbook?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default Addressing a Help File

Bob,

I'm having trouble with the ContextId. When I try to run the macro I am
getting a "HTML Help Author Message" stating that "HH_HELP_CONTEXT
called without a [MAP] section"

I'm not sure what value the ContextId should take or how it is defined
in the HTML help file creation but having looked at some of the work of
Rob Bovey I've been trying to use a value of 120.

Alan


Bob Phillips wrote:
To invoke them, use some code like


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)
Dim hwndHelp As Long
'The return value is the window handle of the created help window.
Dim hwndHH
hwndHH = HtmlHelp(0, ThisWorkbook.Path & "\" & AppId & ".chm",
HH_HELP_CONTEXT, ContextId)
End Sub


where ContextId is defined in the HTML help file creation , and AppId is the
application name (assuming that is used for your help file).



One note, OpenHelp is probably not a good name to use. I had a problem with
one of my addins that conflicted with one of Rob Bovey's, because we both
used that procedure name.


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Alan" wrote in message
ups.com...
I am writing a compiled html help file (.chm format) to be used with a
specific workbook. How can I open and read the help file from within
the workbook?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Addressing a Help File

Alan,

That would depend upon how you setup your HTML file, all of the maps etc.,
which I can't comment on.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Alan" wrote in message
oups.com...
Bob,

I'm having trouble with the ContextId. When I try to run the macro I am
getting a "HTML Help Author Message" stating that "HH_HELP_CONTEXT
called without a [MAP] section"

I'm not sure what value the ContextId should take or how it is defined
in the HTML help file creation but having looked at some of the work of
Rob Bovey I've been trying to use a value of 120.

Alan


Bob Phillips wrote:
To invoke them, use some code like


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)
Dim hwndHelp As Long
'The return value is the window handle of the created help window.
Dim hwndHH
hwndHH = HtmlHelp(0, ThisWorkbook.Path & "\" & AppId & ".chm",
HH_HELP_CONTEXT, ContextId)
End Sub


where ContextId is defined in the HTML help file creation , and AppId is

the
application name (assuming that is used for your help file).



One note, OpenHelp is probably not a good name to use. I had a problem

with
one of my addins that conflicted with one of Rob Bovey's, because we

both
used that procedure name.


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Alan" wrote in message
ups.com...
I am writing a compiled html help file (.chm format) to be used with a
specific workbook. How can I open and read the help file from within
the workbook?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Indirect addressing for linked file ChEBass Excel Worksheet Functions 5 December 11th 08 10:02 PM
Addressing in VBA Richard Excel Discussion (Misc queries) 1 January 23rd 08 01:40 AM
Cell addressing John Excel Worksheet Functions 0 November 30th 06 12:40 PM
VBA Cell Addressing Bill Martin -- (Remove NOSPAM from address) Excel Discussion (Misc queries) 5 March 16th 05 09:51 PM
Addressing the Excel file in which the macro is present. neeraja Excel Programming 1 October 20th 03 10:02 AM


All times are GMT +1. The time now is 03:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"