Link to home
Start Free TrialLog in
Avatar of vlg
vlg

asked on

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

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
Avatar of TwistD_PissR
TwistD_PissR

'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
ASKER CERTIFIED SOLUTION
Avatar of rushka21
rushka21

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vlg

ASKER

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.

No Problem..

Regards
R