- Create a document template containing relevant headers, footers and holes for the report.
- Navigate to "File > Options" and then click on the "Customize Ribbon" tab. Check the "Developer" box in the "Main Tabs" section.
- Navigate to the "Developer" tab and enable the "Design Mode" to distinguish "holes" from fixed content through highlighting.
- To add a new "hole", position the cursor where the hole should be created and press the Rich Text Content Control button "Aa".
- Use the "properties" button to add a title or tag for better identification of the "hole". For the sake of simplicity, add the title "hole1" to the "hole" you created.
- Close the template document after saving it as "ReportTemplate.dotx" in the directory where we will execute our MATLAB code.
- Using the MATLAB code below, the "hole" can now be dynamically filled and will display the appropriate text in the new report document while we will generate using our template.
- https://www.mathworks.com/help/rptgen/report-templates.html
- https://www.mathworks.com/help/rptgen/ug/create-a-microsoft-word-template.html
- https://www.mathworks.com/help/rptgen/ug/add-holes-in-a-microsoft-word-template.html
- https://www.mathworks.com/help/rptgen/ug/modify-styles-in-a-microsoft-word-template.html
- https://www.mathworks.com/help/rptgen/ug/fill-in-the-blanks-in-a-report-form.html