Create Microsoft Word Templates
Use one of these approaches to create a Word template for generating a report.
Use
mlreportgen.dom.Document.createTemplate
to create a copy of the DOM API default Word template that you can then customize. For example,mlreportgen.dom.Document.createTemplate('mytemplate','docx');
Use an existing Word template (for example, a report template for your organization) and customize the template to use with the DOM API.
Create a Word template.
Note
Word for Mac does not support creating holes for DOM API templates. If you need to create a Word template for generating Word documents on a Mac, you can:
Create a template programmatically on the Mac, using the DOM API. See
mlreportgen.dom.Template
andmlreportgen.dom.TemplateHole
.Use Word on Windows® to create your template and copy the template to your Mac.
If you copy an existing template that is not based on the DOM API default Word template, apply any standard Word styles such as Title, Heading 1, TOC 1, List 1, and Emphasis to an element in the template. You can apply the styles to placeholder content and then remove the content. That process creates instances of the standard styles in the template style sheet.
For information about how to create templates and to copy styles from one template to another, see https://support.microsoft.com/word.