First, prepare the Word document to use the bookmarks from DCM. We will work on a pre-filled file located in the Practice Resources folder.
Editing the Word document
Open the MS Word, under the Developer tab turn on Design Mode.
Note: If you don't have the developer tab visible, then follow these steps to show the Developer tab in your Office application:
Here is a list of some bookmarks available that you can use in MS Word:
- Open the MS Word file LTR_Tutorial_Notification Letter_highlighted.docx located in the folder Practice Resources.
Select the case number from the ‘RE: Application #: CASE-2017-183’ text and click Rich Text Content Control in the Controls section on the Developer tab. Now we can notice the control border around our selected text. At this point, we have a container filled with a static value.
To make this control dynamic, in the sense that this control will be discovered by the letter generation engine and replaced with the desired value, we need to tag this control with a bookmark name.
- On the Content Control Properties dialog, fill in the Tag field the bookmark name CaseId. Copy the same value to the Title field. Click on the OK button.
Select Sir/Madam and click Rich Text Content Control in the Controls section on the Developer tab.
Keep the control selected and click on the menu in the Controls section. Now on the Content Control Properties dialog, fill in the Tag field the bookmark name APPLICANT_NAME. Copy the same value to the Title Click on the OK button.
Add the tag CASE_CREATEDDATE_SD in the Submitted Date
Finally, insert the using the SYSTEM_DATE tag in the paragraph Generated on 10/18/2017
Save the document with a different name.
Your document might look like the following
Registering the MS Word Template
We have a letter template with tagged controls. Now is the time to return to our DCM solution to add this MS Word template.
Open the Letter Generation application in the AppBase application selector. In Letter Templates, add a new MS Word template.
Select ‘MS Word’ from the Type drop list. Enter ‘NOTIFICATION_LETTER’ for Name and select ‘Case’ for Root Object Type.
Select the Template Content button
Upload the MS Word letter template file created in the previous steps.
- Save the template.
After saving the new template, Select the Test Template button. Insert a valid Case Number to test our new template, click on the Run button.
After a few seconds, the generated MS Word document will be ready to download and will be saved with a name pattern like ‘LTR_Tutorial_Notification_Letter_99a99b.docx’.