Freelance Writing Jobs | Today's Articles | Sign In

 

Microsoft HTML Help Workshop (HHW)

User Documentation Support for Desktop Applications

Nov 27, 2008 Harry P. Schlanger

HHW is a free documentation project for producing an external Help module, which can be called from the main program application or from any MS Office product.

Microsoft HTML Help Workshop is an Integrated Development Environment (IDE) tool, in which a number of web pages are used to describe the main application and “compiled” into a working external program. These linked pages must first be created in any familiar HTML software of choice, such as FrontPage or Dreamweaver and imported into HHW.

The HHW project IDE is available for free from Microsoft. A tutorial is available by Char James-Tanny.

The HHW Interface
Microsoft HTML Help Workshop produces desktop or online documentation in a specific format. A sample Help module is shown in Figure 1. It has a tree structure menu on the left side and a right window to display HTML content. Figure 2 is a screen shot of the HHW project interface. It has a left window for displaying information as indicated by the three tabs (shown in red):
  1. A Project tab
  2. A Contents tab
  3. An Index tab

The right window displays details of the left window contents. The developer enters the project environment variables, including project name, etc. Content is then added by defining the location of HTML files that will appear in the right view window. Last, an index and search facility can be set up for searching the help files.

Compiling the Help Executable
The help module that HHW produces is a compiled executable that can be called in code from a main program such as VB.Net. The help module can also be called using VBA from any Microsoft Office product, such as Word, Excel, etc. Just beneath the "Test" menu is an icon that resembles a meat grinder. Clicking on this button begins compilation of the help file with instructive messages appearing in the right window.
Calling Help from the Main Application

In VB or VB.Net, a single line of code is required to call a help executable, named MyHelp.chm:

Call Shell("hh.exe " & "c:\MyHelp", AppWinStyle.NormalFocus)

As an example to call Help from an MS Office 2007 product such as Excel, follow these steps:

  • Using File/Save As…convert a .xlsx file to a macro-free file with file extension .xlsm
  • Create a button in the in the spreadsheet. For this action the developer tab needs to be enabled. If not available, this needs to be setup under the Excel Options/Popular menu (first click on the big round dot, top left corner) and check the “Show Developer Tab in the ribbon” checkbox. Then click on Developer/Insert/button (form control) to create the button.

Once this is done, inside the Visual Basic Module, copy and paste the following code to replace the existing empty subroutine:

Public Const HH_HELP_CONTEXT = &HF
Public Const HH_DISPLAY_TOPIC = &H0
Public Declare Function HtmlHelp Lib "HHCtrl.ocx" Alias "HtmlHelpA" _
(ByVal lhwndCaller As Long, ByVal sFileName As String, _
ByVal lCommand As Long, ByVal lData As Any) As Long
Sub Button1_Click()
Call HtmlHelp(0, ThisWorkbook.Path & "\MyHelp.chm", HH_DISPLAY_TOPIC, "My First HHW")
End Sub

After the code is pasted, simply change the file name MyHelp.chm to a more convenient name.

Summary

Microsoft HTML Help Workshop is a user-friendly, attractive interface for producing a Help executable for desktop applications. It works by first producing the HTML pages, importing them into the project and compiling as a single file. Help can then be called by code from the main application or downloaded from the internet as an activeX object.

The copyright of the article Microsoft HTML Help Workshop (HHW) in Computer Programming is owned by Harry P. Schlanger. Permission to republish Microsoft HTML Help Workshop (HHW) in print or online must be granted by the author in writing.
Figure 1. A Help modules produced with HHW, Harry P. Schlanger Figure 1. A Help modules produced with HHW
Figure 2. The HHW Interface, Harry P. Schlanger Figure 2. The HHW Interface
Help , Harry P. Schlanger Help
What do you think about this article?

NOTE: Because you are not a Suite101 member, your comment will be moderated before it is viewable.
post your comment
What is 10+6?
;