Solved

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

Posted on 2003-10-24
4
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

691 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