

Part 2: Use code in C# to generate documents based on template Similarly, you can also add other types of controls such as checkboxes, date pickers and even repeating sections (it supports nested repeating sections too! - since Word 2013) and map data from XML to those using just native Word functionality and without any third party tools! Note: Alternatively, instead of adding the Plain Text Content Control items from the developer tab on step #8, you could right click on the field you want to map on the XML Mapping Pane -> Click Insert Content Control -> Click Plain Text. Repeat for all the fields you want to map.

Note 2: The xmlns attribute can contain literally anything you want and it doesn't have to be a URL starting with http. XML file(s) with real data in this same format can later be applied when generating Word document(s) from the template. Note 1: This is will be just a sample XML to create your Word template. This is the value in field3 from the XML file This is the value in field2 from the XML file This is the value in field1 from the XML file For testing I didn't have repeating sections, pictures etc. Preferably start with a less complicated version to get the hang of it. Create a sample XML based on which you can create the Word template for document generation.Part 1: Create your template document for document generation

Part 2: Use code in C# to generate documents based on template.Part 1: Create your template document for document generation.
CAN I ADD A TEMPLATE TO WORD FOR MAC 2016 HOW TO
Figured out how to use content controls to generate documents and how to populate data from an XML into content controls.
