My previous post was related to a question from a customer, who wants to do command line builds with Help Builder. Help Builder doesn’t have native command line support except for a few administrative features, but it does of course have a fairly complete COM API.

 

So with a few lines of VBScript code you can essentially build your project from a Visual Studio Build. Here’s the VBScript code to build your project:

 

if (WScript.Arguments.Count < 1) then

   MsgBox "No Project File passed."

else

   BuildProject WScript.Arguments(0)

end if

 

FUNCTION BuildProject(ProjectName)

 

SET loHelp = CREATEOBJECT("wwHelp.wwHelp")

 

IF NOT loHelp.Open( ProjectName) THEN

   MsgBox "Couldn't open " + ProjectName

   Exit FUNCTION

END IF

 

loHelp.generatehtml()

loHelp.generateindex()

loHelp.generatetoc()

loHelp.compileproject(true)

 

loHelp.Close()

 

END FUNCTION

 

My VBScript coding is a little rusty – I can’t remember how to properly return results from scripts <g> or even how to do an early exit from the main function. But anyway this script works and should be a good start for working with Help Builders API.

 

And here you thought you’d never see any VB code on my Blog <g>…

 

Incidentally better command line support is one of the things on my list for Help Builder. It’s been on the list for a long time, but it’s always been kinda low on the list primarily because the COM API is available and it’s much more flexible than what you would be able to do with a command line, although it does require the intermediary of a script file or wrapper Exe. I’ll get to it…