PDA

View Full Version : [SOLVED:] Help Help



johnske
10-03-2004, 04:33 PM
Hi everybody,

Can someone pls tell me how to create a custom Help file and (say) assign it to the "?" button on an input box?... :confused: (I've been generally sidestepping this issue by usually having a help button to show a userform but this neglects the issue and is not much use on an input box)

much TIA
John :bink:

Jacob Hilderbrand
10-03-2004, 05:13 PM
You need to create the help file with special software designed to make help files. Most of these programs you have to buy, but I have found one that is free (the one I use obviously :) ). You can download it here.

http://www.danish-shareware.dk/soft/shelpm/

Create the help file then in the VBE goto Tools | VBAProject Properties and assign the help file to the project.

johnske
10-03-2004, 05:24 PM
COOL!! :vv

Thanx Jacob, will download it and look at this. I didn't know you needed a tool, I thort it was just because (as usual) I was too stupid to work it out....

John :bink:

I also have another problem on a totally different topic, so will post as a new question in a few mins...

Jacob Hilderbrand
10-03-2004, 05:39 PM
You're Welcome

If you need any help using the program let me know.

lucas
10-03-2004, 07:33 PM
Great question John!
Jacob,
I downloaded the helpfilemaker program you suggested and am able to use it on a userform if they click F1. I just have a couple of questions?
Could you give a little insight into how to call the helpfile from a button on a userform(if possible).

Also after assigning the path and ContextID, I was wondering if the help file has to accompany the excel file if it is sent out...if so can the path be relative to the excel file?

By the way, Thanks Jacob. Thanks to you and the others here at VBAExpress my apps are looking like someone besides me had been working on them(a professional for example)


Edit: I found that you can put the help file in the same directory and move them together if you call it from the form like this:



Private Sub CommandButton2_Click()
Application.Help "helpfile1.hlp", 1
End Sub

Jacob Hilderbrand
10-03-2004, 08:52 PM
You can set the help context ID for a command button and then when a user presses the question mark on the user form then the command button they would get the help text.

If you want to just open the entire help file from a button try this:



Option Explicit

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

Sub OpenAnyFile()
Dim FilePath As String
Dim FileName As String
Dim FileToOpen As String
FilePath = ThisWorkbook.Path
FileName = "FileName.hlp"
FileToOpen = FilePath & "\" & FileName
Call ShellExecute(0, "Open", FileToOpen & vbNullString, vbNullString, vbNullString, 1)
End Sub

Anne Troy
10-08-2004, 07:53 AM
Added that link to the bottom of www.vbaexpress.com/resources.htm (http://www.vbaexpress.com/resources.htm)