--- title: "Inserting text files via data field" slug: "inserting-text-files" description: "Insert text files into Word templates using dox42, customizing training certificates based on success levels with ease. Learn how to set it up!" tags: ["AddIn V5.0.4.2", "task"] updated: 2026-11-04T10:40:41Z published: 2026-11-04T10:40:41Z canonical: "help.dox42.com/inserting-text-files" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://help.dox42.com/llms.txt > Use this file to discover all available pages before exploring further. # Inserting text files *This content applies to:* ![](https://cdn.document360.io/3acc69da-1de2-431d-95a6-08ae83717b4a/Images/Documentation/DOCX-Add-In_IconBadge.svg) ![](https://cdn.document360.io/3acc69da-1de2-431d-95a6-08ae83717b4a/Images/Documentation/PPTX-Add-In_IconBadge.svg) --- You can insert the content of other text files like Word, RTF or HTML via data field. For example, if you want to display different texts on training certificates depending on the participant’s success level. The data source contains the partial file path to the text file and the dox42 Add-In completes and follows this path to include the text file into the generated document. ![Congratulations message highlighting dox42 expertise and celebrating outstanding performance.](https://cdn.document360.io/3acc69da-1de2-431d-95a6-08ae83717b4a/Images/Documentation/Bildschirmfoto 2025-06-30 um 13.05.08.png) Example for a text file for inclusion ## Steps 1. Add the needed text file(s) in or below the same folder as the template. 2. Set up your data source to contain the partial file path to the text file. In the following example the text files are stored in a subfolder named `Textblock`. ![List of participants with their success status and training details in a table format.](https://cdn.document360.io/3acc69da-1de2-431d-95a6-08ae83717b4a/Images/Documentation/Bildschirmfoto 2025-06-30 um 12.59.45.png) Example of a text file data field in an Excel data source 3. In Microsoft Word or PowerPoint, open your document template. 4. Go to the **dox42** ribbon and select **Insert** **Data Field.** ![Toolbar displaying various functions like Generate, Data Map, and Refresh Template options.](https://cdn.document360.io/3acc69da-1de2-431d-95a6-08ae83717b4a/Images/Documentation/setting-up-the-d365-fscm-data-sources-image-6me2xixz.png) **dox42** ribbon The **dox42 Data Fields** explorer opens, which contains all the components of the data map. 5. [Insert a new data field](/help/docs/inserting-data-fields) or select the already inserted data field in the template that contains the path to text file. The details of this placeholder are displayed in the **dox42 Data Fields** explorer. 6. From the **Type** dropdown select one of the following entries: 1. WordDoc 2. Rtf 3. Htmlfile 4. PDF 7. In the **Directory/URL** text field enter the ` <%DOCPATH%>` variable to complete the file path to the text files. The `<%DOCPATH%>` variable contains the document template’s path. In our example the dox42 Word Add-In will now complete the path defined in our Excel data source with the document template’s folder path. This could look like this: `C:/Document Templates/Training_Certificate/TextBlock/Distinction.docx` ![Settings for creating a Word document with directory path placeholder displayed.](https://cdn.document360.io/3acc69da-1de2-431d-95a6-08ae83717b4a/Images/Documentation/Bildschirmfoto 2025-06-30 um 13.03.23.png) WordDoc settings 8. Select **OK**. 9. Save the template. ## Result You have inserted a text file via data field. When you [generate](/help/docs/generating-a-document-for-testing-1) the document, the data field will include the contents of the text files. ![A training certificate congratulating Martina Musterfrau on her outstanding performance and success.](https://cdn.document360.io/3acc69da-1de2-431d-95a6-08ae83717b4a/Images/Documentation/Bildschirmfoto 2025-06-30 um 14.42.31.png) Generated document with included content from the text file `Distiction.docx`