Calling a custom help file using F1

L

LarryEllefson

I have been trying for weeks to find out how to call my custom .chm file
using the F1 key OR when the user clicks the Help icon. I want to use this in
a runtime app I wrote since Windows Help is disabled in runtime. Does anyone
know how I can do this? I have looked all over the net and in discussion
groups. I have been unable to use this:

Declare Function HTMLHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal
hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, ByVal
dwData As Double) As Long

because I have no clue what hwnd or hwndCaller is or how to find out what
they are. I further don't know where this command is supposed to go or how to
use it. Everyone says to use it, but no one tells you how.

Does this activate the F1 key for custom help files?
How do you use this command?
Where does this command reside in my VBA code?

I am a beginner in VBA and don't have the level of expertise yet to do this.
Can someone please help me.

I just wish to call my custom .chm file from F1 in a runtime Access 2007
app. Thank you so much in advance for anyones help.
 
L

LarryEllefson

I have indeed tried this on many ocassions. I always get HH_HELP_CONTEXT
called withiout [MAP] section errors. I have tried to understand how to "Map"
and create "headers" in Help Workshop, but it is so far beyond my programming
abilities that I finally gave up. I really don't not want to use
"context-sensitive" windows, I just wish to open my .chm file to the first
topic and let the user decide which topic to read. Currently, the .chm file
is opened by a command button on each form using the OnCick() and VBA Shell()
command. It works fine but I just thought using F1 would be better since when
I create the file in Runtime, F1 is disabled by Microsoft. Which begs the
question...can my custom .chm file be called anyway in runtime? Maybe it
can't...I don't know. Thank you so much for your quick response. I really
appreciate that.
 
D

Douglas J. Steele

You should be able to use the AutoKeys macro to assign the F1 key to run
your own code to open the .chm file. At least, that's how it works prior to
Access 2007, and I don't have Access 2007 installed on this machine to let
me test that that's still the case.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


LarryEllefson said:
I have indeed tried this on many ocassions. I always get HH_HELP_CONTEXT
called withiout [MAP] section errors. I have tried to understand how to
"Map"
and create "headers" in Help Workshop, but it is so far beyond my
programming
abilities that I finally gave up. I really don't not want to use
"context-sensitive" windows, I just wish to open my .chm file to the first
topic and let the user decide which topic to read. Currently, the .chm
file
is opened by a command button on each form using the OnCick() and VBA
Shell()
command. It works fine but I just thought using F1 would be better since
when
I create the file in Runtime, F1 is disabled by Microsoft. Which begs the
question...can my custom .chm file be called anyway in runtime? Maybe it
can't...I don't know. Thank you so much for your quick response. I really
appreciate that.
--
Larry


Albert D. Kallal said:
Have you tried this approach:

http://office.microsoft.com/en-us/access/HP051885411033.aspx

It not clear you are using help context id's for each form + controls, or
this is just one help file?

Anyway, you simply just have to type in the name of the help file in the
forms property sheet and you are done. You do not have to write any code
at
all here.
 
L

LarryEllefson

I tried to follow the directions on how to do this but was unable to get the
Autokeys macro to recognize my VBA code to run. And when Itried the
Expression builder, it gave me name of my module but refused to enter the
procedure in the Expression box. I typed the module in manually but it still
would not recognize the VBA code. By the way I also tried to make
"Header"files and context files for my Help Workshop project. I encode the
files just like the examples they give you in the Workshop instructions but
still no luck. Thanks again for trying to help.
--
Larry


Douglas J. Steele said:
You should be able to use the AutoKeys macro to assign the F1 key to run
your own code to open the .chm file. At least, that's how it works prior to
Access 2007, and I don't have Access 2007 installed on this machine to let
me test that that's still the case.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


LarryEllefson said:
I have indeed tried this on many ocassions. I always get HH_HELP_CONTEXT
called withiout [MAP] section errors. I have tried to understand how to
"Map"
and create "headers" in Help Workshop, but it is so far beyond my
programming
abilities that I finally gave up. I really don't not want to use
"context-sensitive" windows, I just wish to open my .chm file to the first
topic and let the user decide which topic to read. Currently, the .chm
file
is opened by a command button on each form using the OnCick() and VBA
Shell()
command. It works fine but I just thought using F1 would be better since
when
I create the file in Runtime, F1 is disabled by Microsoft. Which begs the
question...can my custom .chm file be called anyway in runtime? Maybe it
can't...I don't know. Thank you so much for your quick response. I really
appreciate that.
--
Larry


Albert D. Kallal said:
Have you tried this approach:

http://office.microsoft.com/en-us/access/HP051885411033.aspx

It not clear you are using help context id's for each form + controls, or
this is just one help file?

Anyway, you simply just have to type in the name of the help file in the
forms property sheet and you are done. You do not have to write any code
at
all here.
 
D

Douglas J. Steele

Was your VBA code a function or a sub? (It must be a function to be called
from a macro)

Was your VBA function in a stand-along module? (not a class module nor a
module associated with a form or report)

How did you attempt to call the VBA function from your AutoKeys macro?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


LarryEllefson said:
I tried to follow the directions on how to do this but was unable to get
the
Autokeys macro to recognize my VBA code to run. And when Itried the
Expression builder, it gave me name of my module but refused to enter the
procedure in the Expression box. I typed the module in manually but it
still
would not recognize the VBA code. By the way I also tried to make
"Header"files and context files for my Help Workshop project. I encode the
files just like the examples they give you in the Workshop instructions
but
still no luck. Thanks again for trying to help.
--
Larry


Douglas J. Steele said:
You should be able to use the AutoKeys macro to assign the F1 key to run
your own code to open the .chm file. At least, that's how it works prior
to
Access 2007, and I don't have Access 2007 installed on this machine to
let
me test that that's still the case.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


LarryEllefson said:
I have indeed tried this on many ocassions. I always get HH_HELP_CONTEXT
called withiout [MAP] section errors. I have tried to understand how to
"Map"
and create "headers" in Help Workshop, but it is so far beyond my
programming
abilities that I finally gave up. I really don't not want to use
"context-sensitive" windows, I just wish to open my .chm file to the
first
topic and let the user decide which topic to read. Currently, the .chm
file
is opened by a command button on each form using the OnCick() and VBA
Shell()
command. It works fine but I just thought using F1 would be better
since
when
I create the file in Runtime, F1 is disabled by Microsoft. Which begs
the
question...can my custom .chm file be called anyway in runtime? Maybe
it
can't...I don't know. Thank you so much for your quick response. I
really
appreciate that.
--
Larry


:

Have you tried this approach:

http://office.microsoft.com/en-us/access/HP051885411033.aspx

It not clear you are using help context id's for each form + controls,
or
this is just one help file?

Anyway, you simply just have to type in the name of the help file in
the
forms property sheet and you are done. You do not have to write any
code
at
all here.
 
L

LarryEllefson

I am doing the "Happy Dance". Although I didn't get the macro to work, I was
able to tie F1 to my custom file and deploy it in my application by editing
my help file directly with Notepad instead of using Help Workshop. I found
out that Workshop has a bug that dosen't allow you to "Map" your files
properly and you have to use Notepad to make necessary adjustments. The
directions were buried deep in Microsofts Support documents and I actually
found it by accident, but again, I only spent 2 weeks time on this when it
should have been 2 hours. Thank you again for your kind help.
--
Larry


Douglas J. Steele said:
Was your VBA code a function or a sub? (It must be a function to be called
from a macro)

Was your VBA function in a stand-along module? (not a class module nor a
module associated with a form or report)

How did you attempt to call the VBA function from your AutoKeys macro?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


LarryEllefson said:
I tried to follow the directions on how to do this but was unable to get
the
Autokeys macro to recognize my VBA code to run. And when Itried the
Expression builder, it gave me name of my module but refused to enter the
procedure in the Expression box. I typed the module in manually but it
still
would not recognize the VBA code. By the way I also tried to make
"Header"files and context files for my Help Workshop project. I encode the
files just like the examples they give you in the Workshop instructions
but
still no luck. Thanks again for trying to help.
--
Larry


Douglas J. Steele said:
You should be able to use the AutoKeys macro to assign the F1 key to run
your own code to open the .chm file. At least, that's how it works prior
to
Access 2007, and I don't have Access 2007 installed on this machine to
let
me test that that's still the case.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I have indeed tried this on many ocassions. I always get HH_HELP_CONTEXT
called withiout [MAP] section errors. I have tried to understand how to
"Map"
and create "headers" in Help Workshop, but it is so far beyond my
programming
abilities that I finally gave up. I really don't not want to use
"context-sensitive" windows, I just wish to open my .chm file to the
first
topic and let the user decide which topic to read. Currently, the .chm
file
is opened by a command button on each form using the OnCick() and VBA
Shell()
command. It works fine but I just thought using F1 would be better
since
when
I create the file in Runtime, F1 is disabled by Microsoft. Which begs
the
question...can my custom .chm file be called anyway in runtime? Maybe
it
can't...I don't know. Thank you so much for your quick response. I
really
appreciate that.
--
Larry


:

Have you tried this approach:

http://office.microsoft.com/en-us/access/HP051885411033.aspx

It not clear you are using help context id's for each form + controls,
or
this is just one help file?

Anyway, you simply just have to type in the name of the help file in
the
forms property sheet and you are done. You do not have to write any
code
at
all here.
 

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

Top