Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

executing help file manually

Posted on 2001-06-11
2
Medium Priority
?
151 Views
Last Modified: 2010-05-02
Hi


I have a help file that I wish to open by pressing on a button. How do I do that ?

Thanks,

Liron
0
Comment
Question by:lirong
2 Comments
 
LVL 1

Accepted Solution

by:
Ranger2081200 earned 200 total points
ID: 6176288
Liron,

Put this code in your general declaration area:

Private 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
--------------------------------------------------------

Next enter this code into your click event for your button:

Private Sub cmdHelp_Click()

    On Error GoTo ErrHandler

    Dim hinst As Long
    Dim My_Help As String

    My_Help = App.Path

    hinst = ShellExecute(Me.hwnd, vbNullString, "MyHelp.chm", vbNullString, My_Help, 1)

    Exit Sub

ErrHandler:
    MsgBox "Your program has encounter a problem loading help."
   
End Sub

In the above the MyHelp.chm is the name of the help file.
My_Help is the path.

Hope this helps. :)
Later...
0
 
LVL 3

Expert Comment

by:wpsjr1
ID: 6177658
If you're using the .hlp type help file you'd use WinHelp API.

http://msdn.microsoft.com/library/psdk/shellcc/shell/Functions/WinHelp.htm
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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

916 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