Application.SelectTemplate Method

This method opens a modal dialog that displays the specified library, allowing the user to select a template. The path, title, and description of the selected template are then passed back to the integrating program.

Syntax

void SelectTemplate ( string libPath, bool bOpen, out string tplPath, out string tplTitle, out string tplDesc )

Parameters Description
libPath The file system path to the library the integration must open. This path must point to an .HDL file. If this path is an empty string (""), then HotDocs will attempt to display the last library the user viewed.
bOpen If bOpen == true, then the modal dialog will include an 'Open' button, allowing the user to open a different library. If bOpen == false, then the modal dialog will not contain an Open button, and the user cannot open a different library.
tplPath Contains the file system path (including file name) of the selected template. If no template was chosen, this is an empty string ("").
tplTitle [optional] Contains the template title of the selected template.
tplDesc [optional] Contains the template description of the selected template. As a note, template descriptions can be quite long, so if you use this parameter, this method could use a lot of memory.

Example

The following Visual C# example displays a dialog box where users can select a template. It then displays information about the template selected:

public class ExampleCode
{
    static void Main()
    {
        string sTitle, sDescription, sPath;
        string sLibrary = @"C:\Documents\HotDocs\Libraries\DOCX Tutorial Templates.hdl";
        HotDocs.Application app = new HotDocs.Application();
         
        app.SelectTemplate(sLibrary, true, out sPath, out sTitle, out sDescription);
         
        Console.WriteLine("Title:\t{0}\nDescription:\t{1}\nPath:\t{2}",sTitle,sDescription,sPath);
    }
}