Solved

executing help file manually

Posted on 2001-06-11
2
142 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 50 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

786 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