Use Includes

KCM Designer is all about reusable content. Different Master Templates can make use of single functions and procedures, such as date and address. When working with Master Templates, you can refer to these functions instead of writing them manually every time. For that, use Includes – these are KCM objects containing functions and procedures that can be reused in multiple Master Templates. Includes are compiled in Master Templates.

In KCM Designer, when a change is applied to an Include, it affects each Master Template that makes use of this Include. To prevent errors, we recommend that you recompile a template after an Include is updated.

Create, view, and edit Includes

You can create, view, and edit an Include in KCM Designer, automatically opening Microsoft Word.

Microsoft Word 2016 or later is required.

  1. Navigate to Master Templates > Includes.
  2. Click Includes and then click New Include in the New pane on the right.

    The New Include window appears.

  3. Enter a name for the new Include and click OK.
  4. Click the new Include and then click Edit in the View and Edit pane on the right.
    1. To view the content, click View.
      The Include opens as a read-only document in Microsoft Word.

      If you edit the file in this mode, it can only be saved to a local storage.

    2. To edit the content, click Edit.
      The Include becomes fully available for editing in Microsoft Word. If you did not have an "In development" revision, it is created. On save, the "In development" revision will be updated.
  5. Add or paste necessary code and close Microsoft Word. If an error occurs, click View error document.

    To attach an Include to a document, see the next section.

Alternatively, you can download the Include to your computer to edit it in the editor of your choice and then upload it back to KCM Designer. To do so, click the object and then click Download for editing locally in the View and Edit pane on the right. Click Just download or Lock and download to lock the object for other users. When you finish editing the object in your editor, save it and then click Upload locally edited file in KCM Designer to upload the file from your computer.

Attach an Include to Master Template

To prevent errors, do not rename an Include once it is in use.

  1. Navigate to Master Templates.
  2. Select the Master Template to attach an Include and then click Edit in the View and Edit pane on the right.

    Master Template opens in Microsoft Word.

  3. Create a new paragraph where you need to insert an Include, place the cursor in the new paragraph, and type __INC(the name of the Include).
  4. Add all the needed __INC instructions and close Microsoft Word.
  5. Save the changes when prompted to do so.