Skip to main content
Mitratech Success Center

Client Support Center

Need help? Click a product group below to select your application and get access to knowledge articles, webinars, training content, and release notes or to contact our support team.

Authorized users - log in to create a ticket, view tickets status and check your success plan details.

 

Creating Custom HotDocs Templates

Using HotDocs Developer, you can create a template to be accessed from the Reports module in Secretariat or eCounsel or from the Corporate Meeting Wizard or Global Appoint/Promote/Retire Wizard in Secretariat. For the wizards in Secretariat, Mitratech recommends using a standard template as a basis for customizations (see below). Since no standard templates exist for eCounsel, a new template must be created (see Creating a New Template).

Setting Macro Security in Microsoft Word

If the macro security setting in your word processing program is set to high, you will not be able to edit a HotDocs template. Change the setting to medium. Ask your System Administrator or IT department if you need instructions. The instructions below refer to Microsoft Word 2010.

To Set Macro Security in Microsoft Word:

  1. Open Microsoft Word.
  2. On the File ribbon, click Options.
  3. On the Word Options dialog box, select Trust Center.
  4. Click the Trust Center Settings button.
  5. Click on the Enable all macros option.
    þÿ Setting the security to Disable all macros with notification means that you will need to enable macros each time you open a template. Setting the security to Enable all macros does not require enabling macros.
  6. Click OK.
  7. Click OK.

Creating a Template from an Existing Standard Template

HotDocs Developer, which must be available on your computer in order to edit document templates is needed to test and compile the template for upload into Suite.

Copying a Standard Template

When creating a new template for Secretariat, Mitratech recommends starting with an existing standard template and making changes to that template.

To Copy a Standard Template:

  1. Create a folder on your computer to temporarily hold the template files.
  2. Copy and rename a template (both the *.rtf and *.cmp files) you want to use as the base for a new customized template (HotDocs templates are available on the installation media in the Templates\HotDocs directory), saving it in the folder from Step 1. Mitratech recommends selecting a template similar to the one you would like to produce.

Creating a New Library

Every template in HotDocs Developer must reside in a library, which is only used to classify the templates while developing them.

To Create a New Library:

  1. Open HotDocs Developer.
  2. On the HotDocs Developer window, click the þÿ New Library button.
    þÿ
  3. On the New Library dialog box, type a name in the File Name field (such as “Custom Templates”), then press the <TAB> key twice to add the library extension to the filename and populate the Title field.
  4. Click OK.
    þÿ

Adding a Template

Existing templates can be added to a library as long as the RTF and CMP files are available for the template.

To Add the Copied Template:

  1. On the HotDocs Developer window, click the þÿ Add Item button.
    þÿ
  2. On the Add Item dialog box, leave the type as is, then click the Browse button to select the template from Step 2 in “To Copy the Standard Template”.þÿ
  3. Click OK.

Editing a Template

Once a template has been added to HotDocs Developer, it can be previewed and edited in Microsoft Word as needed.

To Edit the Custom Template:

  1. On the HotDocs Developer window, click the Preview tab to verify the correct template has been selected.þÿ
  2. Click the þÿ Edit button.
    þÿ
  3. Modify the template as needed in Microsoft Word, adding any necessary variables to the template. Be careful not to remove any variables (in blue text) that you want to contain values in the generated document. See Using HotDocs to Customize a Standard Template for more information.

Saving a Template

After a template has all the customizations completed, you can save the template for testing and publishing.

To Save the Custom Template:

  1. When you have finished editing the template in Microsoft Word, click the þÿ Save button on the HotDocs ribbon. Do not save the document using the Microsoft Word save functionality.
    þÿ
  2. Close the document; again using the þÿ Save and Close button on the HotDocs ribbon not the word processor ribbon.

Testing a Template

Each template should be tested in a browser because Suite integrates with HotDocs Web application. Any errors that are encountered must be resolved before publishing the template.

To Test the Template:

  1. Right-click on the template in the left pane of the HotDocs Developer window, select Test in Browser from the popup menu, and select JavaScript.þÿ
  2. On the Answer File dialog box, click OK.
  3. The Interview wizard will start. This wizard prompts the user for information for template variables that it was unable to fill from the database. At this time, do not enter any information; click þÿ Finish.
  4. Click OK on the message box that unanswered questions remain.
    þÿ
  5. Click Don’t Save on the message box asking to save changes to the answer file.
  6. The document will open again. Close the document without saving.

Publishing a Template

Publishing a template creates the files needed by Suite to import and run the template from within Secretariat or eCounsel.

To Publish the Template:

  1. On the HotDocs Developer window, click the Tools menu and select the Publishing Wizard menu command.
  2. On the Publishing Wizard dialog box, click the Template files for use with HotDocs Server option.
  3. Browse to a location to create the published files or enter a location in the Local folder for published files text box, and click Next.
    þÿ   Do not use the location of the templates for publishing but create a new subdirectory.
    image
  4. On the File Security screen, click Next.
  5. On the Additional Files screen, click Finish.
  6. On the confirmation message box, click OK.
    image
  7. Locate the new files created from the steps above (<NewFileName>.CMP, <NewFileName>.RTF, and
    <NewFileName>.RTF.MANIFEST.XML). These files should reside in the directory specified in Step 3.
    þÿ If your Suite HotDocs Web application is hosted on an operating system that is case sensitive, make sure that the case for the <NewFileName> matches for all four files. If not, correct the naming before uploading the files.
  8. Add the HotDocs template to the application (see Adding HotDocs Templates to Suite).

Using HotDocs to Customize a Template

When editing a template using HotDocs functionality within your word processor, the following information will aid you in this process:

  • Always click the þÿ Save button on the HotDocs ribbon not the word processor command. This action is necessary to ensure that the template and the companion component file are linked. Saving the file creates a Rich Text Format (RTF) file for the document itself and a CMP component file that contains the HotDocs variables associated with the template.
  • Always close the template using the þÿ Save and Close button on the HotDocs ribbon not the word processor ribbon.
  • The file in the word processor window has two types of text: regular static text (typically in a black font color) and text variables/components (in a blue font color) that retrieve values from Secretariat into the template). Make sure that you do not edit a variable inadvertently when changing text in the document. Doing so will cause the variable to be unusable and the template to be invalid.
  • To add a Mitratech-provided HotDocs variable to a document that is not already in the document, select the variable you want to use from the list of provided variables (see the HotDocs Variables for Secretariat/eCounsel Document Assembly technical notes for a list of variables).

Click the þÿ Component Manager button on the HotDocs ribbon. On the Component Manager dialog box, click the þÿ New Component button.

þÿ

On the New Component dialog box, select the Text Variable component type and click OK.

þÿ All variables provided by Mitratech are text variables with the exception of any variable that ends with “_datetype”. For variables ending with “_datetype”, see below.

þÿ

On the Text Variable Editor dialog box, type the name of the selected variable and click OK. Close the Component Manager dialog box.

image

In the word processor window, click the mouse pointer at the point where you want to create the variable. Click the image Variable Field button on the HotDocs ribbon. On the Variable Field dialog box, select the variable you entered above and click OK.

image

  • For variables ending with “_datetype”, these Mitratech-provided HotDocs variables can be added by selecting the Date Variable component type.

image

On the Date Variable Editor dialog box, type the name of the selected variable, select how you want the date to be formatted, and click OK. Close the Component Manager dialog box.

þÿ All dates from eCounsel or Secretariat will use the ISO format of YYYY/MM/DD by default.

þÿ

In the word processor window, click the mouse pointer at the point where you want to create the variable. Click the Variable Field button on the HotDocs ribbon. On the þÿ Variable Field dialog box, select the variable you entered above and click OK.

þÿ

  • To change properties of a Mitratech-provided HotDocs variable, simply double-click the variable name in the word processor to open the Variable Field dialog box. From this dialog box, you can change the formatting for the value.

þÿ   Do not change the Variable Type of any Mitratech provided variable. Doing so will cause a data type mismatch and render the template unusable.

For example, if a variable includes a forced return as part of the variable, you can specify to remove the forced returns. On the Variable Field dialog box, click the clear the checkmark from the Use default checkbox and click on the Non-breaking checkbox to select it.

þÿ

  • To create multiple REPEAT statements within a table in a template, you must use a computation variable. Computations can be used to format results, and require writing a script using the HotDocs scripting language. To create a computation variable, click the þÿ Variable Field button on the HotDocs ribbon. On the Variable Field dialog box, select the Computation variable and click the þÿ Edit button next to the Variable menu.

On the Computation Editor dialog box, type the name of the variable, and build the script to retrieve results and format them as needed. For example:

þÿ

Creating a New HotDocs Template

HotDocs Developer, which must be available on your computer in order to edit document templates, is needed to test and compile the template for upload into Suite.

þÿ If the macro security setting in your word processing program is set to high, you will not be able to edit a HotDocs template. Change the setting to medium. Ask your System Administrator or IT department if you need instructions.

Creating a New Library

Every template in HotDocs Developer must reside in a library, which is only used to classify the templates while developing them.

To Create a New Library:

The first step in HotDocs Developer is to create a library that will contain all the templates files.

  1. Create a folder on your computer to temporarily hold the template files.
  2. Open HotDocs Developer.
  3. On the HotDocs Developer window, click the btn_New_Library New Library button.
    þÿ
  4.  On the New Library dialog box, type a name in the File Name field (such as “eCounsel”), then press the <TAB> key twice to add the library extension to the filename and populate the Title field. Click OK.
    þÿ

Creating a New Template

When creating a new template, open an existing document to copy the contents into the template or select the option to create from a new (blank) document.

To Create a New Template:

Next, a new template can be created that will reside in the library.

  1. On the HotDocs Developer window, click the btn_New_Template_HotDocs New Template button.
    þÿ

  2. On the New Template dialog box, change the type to Word RTF Template (.rtf).

  3. Type a file name, and then press the <TAB> key twice. Replace the title if needed, and type a description.

  4. Leave the initial contents as Empty unless you have a current file to use.

  5. Click OK. Microsoft Word will open a new document with the file name specified.
    þÿ

Creating Variables for a Template

When you create a new template, you must specify the variables for Secretariat or eCounsel that you want to use within that template.

To Create Variables for the Template:

When creating variables for Suite, use the HotDocs Variables for eCounsel/Secretariat Document Assembly technical notes for lists of available variable names. Also, any custom variables created for your company can be added using these steps.

  1. On the HotDocs Developer window or HotDocs ribbon for the new template file in Microsoft Word, click the image Component Manager button.image
    The first variable that must be created is a select variable that is used with Suite to allow the user to select a record on which the output is based. Available variables include selectentity, selectinvoice, selectmatter, and selectpeople for eCounsel, and SelectSecretariatEntity and SelectSecretariatPeople for Secretariat.

    Each of these will open a list dialog box to select an entity, invoice, matter, or person, respectively.

  2. On the Component Manager dialog box, click the image New Component button.
    image

  3. On the New Component dialog box, leave the Component type as Text Variable, and click OK.
    image

  4. On the New Text Variable dialog box, type “selectmatter” as the variable name, and then type “Select Matter” as the title (this text appears on the dialog box when preparing the document in eCounsel). Optionally, type the text that will appear as a tooltip when running the template. Click OK.þÿ
    The new variable will appear in the Component Manager dialog box.

  5. Repeat Steps 2-4 for each variable that you want to use.

    þÿ All variables provided by Mitratech are text variables with the exception of any variable that ends with “_datetype”. For variables ending with “_datetype”, select the Date Variable component type.

    þÿ For subsequent templates, copy the variables from a component file by clicking the right arrow in the upper-left corner of the Component Manager dialog box. This button expands the dialog box and allows you to open a component file to select variables to copy. Select one or more variables from the existing component file, then click the left arrow to move them to the new component file.
    þÿ

  6. Click HD_btn_Save Save to save the component file.
    þÿ

Adding Variables to a Template

Once a component file has been created with variables from Secretariat or eCounsel, you can add these variables to the new template.

To Add Variables to the Template:

Once you have created the variables, it’s just a matter of dragging-and-dropping the appropriate variable onto the Microsoft Word document.

  1. In the template file in Microsoft Word, first drag the appropriate select variable from the Component Manager dialog box onto the template.þÿ
  2. Next, type the text that you want to appear in the finished document.
  3. Where needed, drag additional variables onto the template file.
    þÿ

þÿ To change properties of a Mitratech-provided HotDocs variable, simply double-click the variable name in the word processor to open the Variable Field dialog box. From this dialog box, you can change the formatting for the value.

For example, if a variable includes a forced return as part of the variable, you can specify to remove the forced returns. On the Variable Field dialog box, click the clear the checkmark from the Use default checkbox and click on the Non-breaking checkbox to select it.

þÿ

þÿ   Do not change the Variable Type of any Mitratech provided variable. Doing so will cause a data type mismatch and render the template unusable.

To change a date format, clear the Use default checkbox, and select a format for the date.

HD_db_Variable_Field_Date_Format

Creating REPEAT and IF Statements

REPEAT statements are needed if a record can have multiple values for a field. For example, to return every player on a matter, you would need a REPEAT statement; otherwise, eCounsel will return only the first record found.

IF statements are useful to target data for return from Suite. For example, if only one primary attorney exists per matter, use an IF statement to specify the role you want returned so only the data you want in the document is returned.

To Create REPEAT and IF Statements:

In order to return multiple records in the document, you must use a REPEAT field. Within the REPEAT field, you also can specify an IF field to filter the data that is returned.

  1. In the template file in Microsoft Word, click the þÿ REPEAT Field button on the HotDocs ribbon.þÿ
  2. On the REPEAT Field dialog box, leave the field type as REPEAT Dialog.
  3. Click the HD_btn_New_Dialog New Dialog button to the right of the Dialog menu.
  4. On the New Dialog dialog box, type a name for the dialog variable, drag-and-drop any components to the contents list box, and click OK. Note that any field used in an IF field to filter the results must be included in the dialog.
    þÿ
  5. Click OK.
    þÿ
  6. In Microsoft Word, place the cursor between the REPEAT and END REPEAT statements, and click the þÿ IF Field button on the HotDocs ribbon.þÿ
  7. On the IF Field dialog box, click on the IF Expression option. Create an expression that can be used to filter the results by dragging and dropping items onto the text box. Click OK when finished.
    þÿ
  8. In Microsoft Word, place the cursor between the IF and END IF statements. Add the variables that you want to appear in the completed document. If multiple variables are placed on the document, make sure to include any punctuation to be included.
    þÿ

þÿ  Multiple IF statements can be specified as criteria for the results by using an AND or OR operator within the IF statement.

For example, the following statements return a player name and primary address for a player with the role of “Partner” with no end date specified (notice that the additional lines of address only appear if they have data):

þÿ

This construct returns the following with test data:

þÿ

Retrieving Data from User Fields

For matters in eCounsel, you can include user fields in your assembled documents provided you construct your HotDocs template to retrieve the applicable values for the user field based on the tab on which the user field appears in the Matters module. The Mitratech provided variables include a “_userfieldprofileid” variable for each of the tabs in the Matters module. The profile identifier can be determined in the User Fields component of Suite Manager as follows:

þÿ

Both single-record tabs and multi-record tabs use nested REPEAT statements to return user field information.

Retrieving User Fields from Single Record Tabs

For tabs with single records (such as the Patent tab above), the HotDocs template must contain a REPEAT for the tab and then a REPEAT for the user fields on the tab so that the document assembly process can return the user fields in the context of the tab on which the fields reside.

þÿ

The Repeated Series dialogs contain only the variables that will be returned (including unused variables in a dialog can cause problems with the result set):

þÿ

To filter the results on criteria such as a specific user field, an IF statement can be created as part of the template:

þÿ

All user fields on the Patent tab are returned as shown in the interview below:

þÿ

However, the IF statement restricts the assembled document to only contain the user field value that matches the filter:

þÿ

Retrieving User Fields from Multi-record Tabs

For tabs with multiple records (such as the Player tab), the HotDocs template must contain a REPEAT statement to return all records on the tab with a nested REPEAT to retrieve the appropriate user field value. The Repeated Series dialogs contain only the variables that will be returned (including unused variables in a dialog can cause problems with the result set):

þÿ

To filter the results on criteria such as a specific user field, an IF statement can be created as part of the template (or as shown in this example, a filter has been created and applied to the Players dialog):

þÿ

All user fields on the Player tab are returned as shown in the interview below:

þÿ

However, the filter restricts the assembled document to only contain the user field value that matches:

þÿ

Saving a Template

After a template has all the customizations completed, you can save the template for testing and publishing.

To Save the Template:

  1. When you have finished editing the template in Microsoft Word, click the btn_Save Save button on the HotDocs ribbon. Do not save the document using the Microsoft Word save functionality.
    image
  2. Close the document; again using the btn_Save_and_Close Save and Close button on the HotDocs ribbon not the word processor ribbon.þÿ

Preparing a Template for Upload

When copying an existing template for Secretariat, certain settings that make the template run with HotDocs Server are already specified. However, when you create a new template, you must configure these settings for each template.

To Prepare the Template for Upload:

  1. On the HotDocs Developer window, click the btn_Component_Manager Component Manager button.
    þÿ

  2. On the Component Manager dialog box, click the btn_Component_Manager_Properties Properties button.
    þÿ

  3. On the Component File Properties dialog box, click on the HotDocs Server tab, and verify that the Enable template for use with HotDocs Server checkbox is checked. If not, click in the checkbox to enable it. Click OK.
    þÿ

  4. On the Component Manager dialog box, click the þÿ Save Component File button.

  5. Close the Component Manager dialog box.

Testing a Template

Each template should be tested in a browser because Suite integrates with HotDocs Web application. Any errors that are encountered must be resolved before publishing the template.

To Test the Template:

  1. Right-click on the template in the left pane of the HotDocs Developer window, select Test in Browser from the popup menu, and select JavaScript.þÿ
  2. On the Answer File dialog box, click OK.
  3. The Interview wizard will start. This wizard prompts the user for information for template variables that it was unable to fill from the database. At this time, do not enter any information; click þÿ Finish.
  4. Click OK on the message box that unanswered questions remain.
    þÿ
  5. Click Don’t Save on the message box asking to save changes to the answer file.
  6. The document will open again. Close the document without saving.

Publishing a Template

Publishing a template creates the files needed by Suite to import and run the template from within Secretariat or eCounsel.

To Publish the Template:

  1. On the HotDocs Developer window, click the Tools menu and select the Publishing Wizard menu command.
  2. On the Publishing Wizard dialog box, click the Template files for use with HotDocs Server option.
  3. Browse to a location to create the published files or enter a location in the Local folder for published files text box, and click Next.
    þÿ   Do not use the location of the templates for publishing but create a new subdirectory.
    þÿ
  4. On the File Security screen, click Next.
  5. On the Additional Files screen, click Finish.
  6. On the confirmation message box, click OK.
    þÿ
  7. Locate the new files created from the steps above (<NewFileName>.CMP, <NewFileName>.RTF, and <NewFileName>.RTF.MANIFEST.XML). These files should reside in the directory specified in Step 3.
  8. Add the HotDocs template to the application (see Adding HotDocs Templates to Suite).

Adding HotDocs Templates to Suite

When a template is enabled for use with HotDocs Server, the following three file types are created:

þÿ

þÿ When converting the HotDocs template for use with eCounsel or Secretariat, HotDocs may generate files with case that does not match. For example:

  • abc_doc_boardconsent.rtf
  • abc_doc_boardconsent.cmp
  • Abc_Doc_Boardconsent.rtf.manifest.xml

Although you can import the files into eCounsel or Secretariat, they will not generate properly. Before importing the files, change the case of all files to match (Mitratech recommends all lowercase).

To Add a HotDocs Template to the Reports Module:

  1. On the Reports List page, click Documents.
  2. Click the þÿ New button.
    þÿ
  3. On the Welcome to the Documents Wizard dialog box, click the Browse in each field in the wizard screen and navigate to the holding directory. Select the appropriate file as shown below. Click þÿ Continue when you are done.
  • For Template, select the .rtf file.
  • For Component File, select the .cmp file.
  • For Manifest File, select the .rtf.manifest.xml file
    þÿ
  1. When the upload is completed, click OK on the confirmation message.
  2. On the New Template dialog box, the Name and Category are required fields. Description is an optional, but recommended, field.
    þÿ For eCounsel templates, make sure and click the checkbox for eCounsel product visibility if you use both eCounsel and Secretariat at your site.
    þÿ
  3. Click þÿ Continue.
  4. Click þÿ Close.

To Add a HotDocs Template to a Wizard:

þÿ   HotDocs templates can only be added to the Corporate Meeting and Global Appoint/Promote/Retire Positions wizards in Secretariat.

  1. On the Wizards List page, click on the wizard to which you want to add a template.
  2. Click þÿ Edit.
  3. On the Wizards dialog box, click þÿ Templates.
    þÿ
  4. On the Template List dialog box, click þÿ New.
    þÿ
  5. On the Wizards dialog box, type a name for the template, select a document type, select a narrative subtype, and click þÿ Save.þÿ
  6. On the Welcome to the Documents Wizard dialog box, click the Browse in each field in the wizard screen and navigate to the holding directory. Select the appropriate file as shown below. Click þÿ Continue when you are done.
  • For Template, select the .rtf file.
  • For Component File, select the .cmp file.
  • For Manifest File, select the .rtf.manifest.xml file
    þÿ
  1. When the upload is completed, click OK on the confirmation message.
  • Was this article helpful?