Solved

executing help file manually

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

705 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now