
Help File - Opens on Find tab not Contents tab
Rob,
Thanks for the detailed coding.
I suspect I have not interpreted it correctly as I couldn't get it to
work.
However, I have found some coding which does work for me. It is as
follows:-
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
Commondialog1.HelpCommand = &HB
Commondialog1.HelpFile = "C:\MyFile.hlp"
CommonDialog1.ShowHelp
ErrHandler:
Exit Sub
End Sub
I had previously had the HelpCommand = cdlHelpForceFile, but found in
the VB Help files that if I was compiling the Help file using MS Help
Workshop 4.0X, then I should change this to HelpCommand = &HB.
It made the difference that I was after.
Thanks again for your time and help
David
Quote:
>Put this in your General declarations:
>Private Declare Function OSWinHelp% Lib "user32"
>Alias "WinHelpA" _
> (ByVal hWnd&, ByVal HelpFile$, ByVal wCommand%, dwData
>As Any)
>Then in your program:
>'******************
>'* Show Help File *
>'******************
>Dim nRet As Integer
>If Len(App.HelpFile) = 0 Then
> MsgBox "Unable to display Help Search. There is no Help
>associated with this project.", vbInformation, Me.Caption
>Else
> On Error Resume Next
> nRet = OSWinHelp(Me.hWnd, App.HelpFile, 3, 0)
> If Err Then
> MsgBox Err.Description
> End If
>End If
>HTH,
>Rob
>>-----Original Message-----
>>I have written a Help file using MS Help Workshop and it
>runs OK except
>>that every time I open Help the Help Contents comes up
>with the Find tab
>>on top. How can I change this so that the Contents tab
>comes up on top
>>when I open the Help file?
>>--
>>David Hewitt Pottery ,
>>7 Fairfield Road, Caerleon, Newport,
>>South Wales, NP18 3DQ, UK. Tel:- +44 (0) 1633 420647
>>FAX:- +44 (0) 870 1617274
>>Web site http://www.dhpot.demon.co.uk
--
David Hewitt Pottery ,
7 Fairfield Road, Caerleon, Newport,
South Wales, NP18 3DQ, UK. Tel:- +44 (0) 1633 420647
FAX:- +44 (0) 870 1617274
Web site http://www.dhpot.demon.co.uk