Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I open a .chm file using vbscript syntax?

Status
Not open for further replies.

funeeldy

Programmer
May 12, 2003
3
0
0
US
I know I can open a .hlp file using this code snippet..

Err.HelpFile = "//mcotepc/public/junk.hlp"
Err.HelpContext = usercontextID
MsgBox "Press F1 for examples", , "", Err.Helpfile, _
Err.HelpContext

But what is the syntax for .chm files?
 
The ERR.HELPFILE supports only the older WinHelp file format, not the newer HTMLHelp format
 
Thanks, I kinda figured that out already. I was asking if there are other vbscript commands which will open a chm file.
 
Wow, this looks a lot uglier than I imagined.

What environment does this script run in? An HTM in IE, an HTA, a WSH/CScript?

Code:
HH.EXE
is the stand-alone CHM viewer, but it doesn't appear to expose an automation interface. There is an HTML Help ActiveX control, but this is an odd duck that looks like it can only be hosted in IE. VB programs have to make API calls into the OCX from what I can see, they can't use the thing as an ActiveX control and drop it onto a form.

This technology looks like Microsoft got it from another dimension. From a WSH script you might end up needing to use one of the IE controls (WebBrowser control?) to host it, or automate an instance of IE itself.
 
I run it in rational clearquest. The schema is customized using either vbscript or perl. I plan to use only ie as my browser application, so something that runs there would be ok. Any suggestion/code snippets for using webBrowser with hh.exe would be appreciated. Also, a pointer to where I could get hh.exe.
 
No, you already have
Code:
HH.EXE
on your machine. That's what runs when you double-click on a CHM or a shortcut to one.

Here's an intro to automating IE from WSH scripts, it may apply in your scripts as well:


The guy is short on telling you how to do things and long on sample code, but it ought to get you started.

The HTML you use in the browser may have to be constructed via the HTML Help Workshop to insert the HTML Help control properly though. You'll need the SDK, but if you are creating custom Help you already have that, right?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top