Solved

executing help file manually

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Suggested Courses
Course of the Month9 days, 1 hour left to enroll

617 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