Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2003-10-24
4
Medium Priority
?
184 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 1000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses

610 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