This method opens the specified library in a modal dialog box, allowing users to select a single template. The path, title, and description of the selected template are then passed back to the integrating program.
The difference between this method and SelectTemplate is the bResolveReferencePaths parameter. When this parameter is FALSE, a template path containing a reference keyword is returned as a reference path (e.g., ^PUBpath\templatename.rtf) instead of being resolved to a full path (e.g., C:\Templates\templatename.rtf). You can then use the ResolveReferencePath method to translate the reference path into a full path as needed.
This method was introduced with the release of HotDocs 2005 SP2.
void SelectTemplate2 ( string libPath, bool bOpen, bool bResolveReferencePaths, 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. |
bResolveReferencePaths | Indicates if a reference path will be resolved into a full file path (TRUE) or left as a reference path (FALSE). |
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. |
The following Visual C# example displays a dialog box where users can select a template. It then displays information about the template selected which resolves to a full path.
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.SelectTemplate2(sLibrary, true, true, out sPath, out sTitle, out sDescription); Console.WriteLine("Title:\t{0}\nDescription:\t{1}\nPath:\t{2}",sTitle,sDescription,sPath); } }