Solved

executing help file manually

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
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 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…

895 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

14 Experts available now in Live!

Get 1:1 Help Now