Using HTML page for VB program documentation (rather than WinHelp):   Return to List

' To open the HTML file use the syntax:

Temp& = StartDoc(FileName)' Filename is required.
' If not in same directory then include full path.

Attribute VB_Name = "WebPagesAsDocumentation"
Option Explicit

' Paste this section into a module...
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

Declare Function GetDesktopWindow Lib "user32" () As Long

Global Const SW_SHOWNORMAL = 1

Function StartDoc(DocName As String) As Long
    Dim Scr_hDC As Long
    Scr_hDC = GetDesktopWindow()
    StartDoc = ShellExecute(Scr_hDC, "Open", DocName, "", "C:\", SW_SHOWNORMAL)
End Function


Sub LaunchFile()
' Paste this section, less sub/end sub, into the control (menu, button, etc.)
' that will invoke the help...

Dim tempvar&, filetoopen$
' Use the filename that you need for the context in question.
' Note that this reference includes App.Path, which is the
' path to the application.

filetoopen$ = App.Path + "\index.html"
tempvar& = StartDoc(filetoopen$)

End Sub



Note to Webmaster