Solved

How to attach/include a .chm file to the Click function on a Help->Topics menu?

Posted on 2003-10-24
4
180 Views
Last Modified: 2010-05-03
Hello

I have a small app, and I have a menu that has Help as an option.  Clicking on Help, you get the About option and a Help Topics option.
When the user clicks on the Help Topics option, I want the myHelp.chm file to be launched (it's MS HTML Help) in it's own little window (as normally happens).

Thanks

v
0
Comment
Question by:vlg
  • 2
4 Comments
 
LVL 1

Expert Comment

by:TwistD_PissR
ID: 9615235
'Declare API
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

'Call it
Public Function OpenHelpFile()
   Dim lngRetVal
   Dim strLocation
   strLocation = app.path & "myHelp.chm" 'Here you put the path to your chm
   lngRetVal = ShellExecute(me.hwnd,"open",strLocation,vbnullString,vbNullString,vbNullString)
   if lngRetVal > 53    
        msgbox "Failure Attempting to Open Help File!"
   end if
End Function

give that a try....

Or

try this: http://www.vbaccelerator.com/codelib/shell/shellex.htm

TwistD
0
 
LVL 1

Accepted Solution

by:
rushka21 earned 250 total points
ID: 9615467
You could also set the help file at load time and if the user presses F1 it will start it up automatically:
App.HelpFile = App.Path & "\Help.chm"

and

Help menu item (click event):
SendKeys "{F1}", False
0
 

Author Comment

by:vlg
ID: 9615991
Hi TwistD

I'm getting a Run time error 13 "type mismatch" when I run your code.
Any thoughts?

Thanks rushka21, I'll try yours now.

0
 
LVL 1

Expert Comment

by:rushka21
ID: 9625328
No Problem..

Regards
R
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question