Application Object |
Provides access to the Help Producer application.
The Application object represents a Help Producer application, and provides access to all other objects used by Help Producer. The Application object can be either used directly through the Help Producer add-in in Microsoft Word (i.e. from a build script), or it can be created programmatically.
The following example shows how to programmatically create a Help Producer Application object from a script running in the Windows Scripting Host.
[JScript]
To run the example, create a file called test.js
. To run the script in the console version of the Windows Scripting Host, execute the following command from the command‑line:
cscript test.js
Contents of test.js
:
main();
function HelpProducer_ConsoleMessage(messageType, message)
{
WScript.Echo(message);
}
function main()
{
try
{
var app = WScript.CreateObject("Word.Application");
var hp = WScript.CreateObject("HelpProducer.Application", "HelpProducer_");
var doc = app.Documents.Open("C:\\test.doc");
hp.Project.Export(doc);
hp.Project.Compile(doc);
}
catch (e)
{
WScript.Echo("Error: " + e.message);
}
if (app != null)
app.Quit(false);
}
[VBScript] No example is available for Visual Basic. To view a JScript example, click the Language Filter button in the upper-left corner of the page.