HowTos‎ > ‎

Introduction to Microsoft Help Workshop 4.0

Note: This was written quite a while back, when I was working with Visual Basic. I've been out of touch with programming for Windows since I began programming in Java so I'm not really familiar with this anymore.

When I was making my SMS programs ready for distribution I wanted to make a help file for them to have a complete package. At first the Help Workshop 4.0 interface didn't make any sense to me and the help file didn't help either, it was more of a reference. I then looked around on the net but didn't really get a straight tutorial to get me started. Most of them were for HTML Help Workshop or how to use it with VC++. I finally did figure out enough to make something, nothing great, not even a complete help file but it works and its some help, so I guess it does what its supposed to.

So I decided to put up a simple little tutorial about how to get started with this. You can always read up the help file to find out what all you can do with Help Workshop.


What you'll need

  • Help Workshop 4.0 (Should find it here:  ..\Visual Studio 6.0\Common Folder\Tools\HCW.exe)
  • .rtf Editor (Word will do fine)
  • Graphics editor (You can use .bmp, .dib, .wmf, .shg or .mrb files. Paint is decent for .bmp)
  • Microsoft Hotspot Editor (Should be here ..\Visual Studio 6.0\Common Folder\Tools\SHED.exe)


Getting Started

  • Right. Now first thing you need to do is decide on your topics. These are the individual pages that'll show up in the help file. For example you may want a Contact Me page where you give your details. This is a topic. Each topic is uniquely identified by a Topic Id. This is a name that you assign the topic. It could be anything, like Contact Me Page. But be careful to keep them unique.
  • Open up Word or whatever editor you're using. Create a new file and save it as a .rtf (Rich Text Format) file. Help Workshop requires you to write your topics in a .rtf file.
  • Write each topic on a separate page, separated by a Page Break (Ctrl+Enter) Each topic requires a Topic Id. The topic id is to be given as a footnote with the symbol #. For Word, goto Insert>Footnote (For Word 2003 it's Insert>Reference>Footnote). In the Custom Mark field enter #. Then type in the topic id for that particular topic.
    
  • Save the file once you're done.
  • Start Help Workshop. Click on File>New. In the dialog box that opens, select Help Projects. Type in the name you wanna give the project and save at your preferred location.
  • The window that opens now has an area that'll show the contents of the project. The buttons on the side are for adding stuff like files, bitmaps etc. I'll just show you how to add the topic files and map topics for a simple help file.
  • Click on the Files button. In the dialog box that appears, click Add. Then using the Open dialog box, navigate to where you saved your .rtf file of topics. Select it and click Ok and Ok on the Topic Files dialog box too.
  • You've now added your topic file and all the topics in that can be compiled to make your help file. However, you won't be able to see them since you don't have a list of contents. So next, we'll make the Help Contents file.
  • Again, click on File>New. This time select Help Contents. In the window that opens, type in the name of the help file in the text field on the top left. I used the same filename everywhere with different extension. For example, I would have projecthelp.hpj, projecthelp.cnt, projecthelp.rtf, projecthelp.bmp etc.
  • Click on the Add Above/ Add Below button to add a particular item in the contents file.
  • In the dialog box you can choose to add a Heading or a Topic. A heading will consist of several topics, it's the closed book symbol in a help file that turns into an open book and expands when you click on it. The topics will be the topics you entered in the .rtf file.
  • For heading, you only give the Title like Getting Started. For a topic, you have to give the title and the topic id (the footer that you entered for each topic).
  • Well, that's it for the basic help file. Now we have to compile. Remember to always save the project/ contents file before compiling otherwise your changes won't reflect in the help file. So File>Save and then File>Compile (or use the buttons).
  • Your help file, projecthelp.hlp will be created. You'll get appropriate errors, warnings etc in a results window, check it out.


A Few Extras

If you want to add graphics, context sensitive help and link your help file to your VB6 project read on.

Adding an image

  • To add an image, all you need to do is type in the following code in your .rtf topic file, at the location you want the image to appear: {bmc filename.bmp}. Instead of the c, you may use some other values, you can check that out in the help file.
  • Save the file and recompile, voila! Your image will appear where you wanted. You can use .bmp, .dib, .wmf, .shg and .mrb files.

Hotspots

To create an image with hotspots i.e. locations where you can click to get up a popup or a link to a corresponding topic, you need to use the Hotspot Editor.
  • Open the Hotspot Editor (SHED.exe) and click File>Open. Select the image you want.
  • Once you open the image, you can click and drag the a hotspots, which will be show as rectangles. Drag them around the area you want to be active.
  • Once you've drawn the hotspot, right click on it to see the options. The Context String should be the topic id of the topic you want displayed or the id of the macro you want to run. Type can be a popup, a jump to the topic or a macro that'll run. Attribute decides if the bounding box for the hotspot will be visible or not. The Hotspot Id is optional. I use the same string as the topic id.
  • Once you've decided your hotspots and entered their context strings, save. The file will be saved as a .shg file.
  • To use this file, simply use the same method you used for the image. {bmc filename.shg}
  • To link your help file to your VB project you can follow two ways. With both, whenever the user presses F1 on the keyboard, the help file will be opened. One is to set the Help File Name under the General tab of the projects Properties dialog (Right click your project, select projectname Properties. But with this you limit yourself to an absolute path that'll need to be the same all the time to use the help file. The other way is to add the following lines to your code so that if the help file is simply placed  in the same location as the application, it'll be used. For other options and information on using help files with VB, you should check out the MSDN Library.
                App.HelpFile = App.Path & "\helpfilename.hlp"

Context Sensitive Help

  • To allow for context sensitive help, you need to give map the topic ids to numeric values. To do this, open the help project for your help file. Click on the Map button on the left. In the dialog box, click on Add. Enter the topic id you want to map and give it a numeric value. It is up to you to assign unique numeric values. Click Ok on both dialogs.
  • Now, in your VB project, select a particular control in the Form Design window and select the HelpContextID property. Here, you should type in the numeric value that you assigned to a particular topic during the map step. Now, whenever that control is selected, and the user presses F1, that particular topic will automatically be opened. You can also choose to have a popup in a WhatsThis style by setting a few more properties. Once again, check out the MSDN Library.
And thats it, you've made a help file, added images, hotspots, linked to a project and added context sensitive help. For more stuff look at the help file with the Help Workshop. I've only used these features as of now, it was all that I needed.
Comments