This utility generates Word documents from templates using Content controls. The utility will be enhanced later as per feedback and source code is available for download at http://worddocgenerator.codeplex.com/. It has been created in Visual Studio 2010 and uses Open Xml 2.0 SDK which can be downloaded from http://www.microsoft.com/download/en/details.aspx?id=5124.
The next parts in this series are
In Part 2 I have discussed about
- · List of functionalities that can be achieved using the utility/source code
- · Description regarding Samples provided with utility
- · New samples added in this update
In Part 3 I have explained one of the way to “Refresh the document from within the document(e.g. right click on document and click Refresh) using document-level projects for Word 2007 and Word 2010“
The purpose of creating this utility was to use the Open Xml 2.0 SDK to generate Word documents based on predefined templates using minimum code changes. These documents can either be refreshable or non- refreshable. I’ll explain this difference later. Also there is no dependency that Word should be installed.
A few samples for generating Word 2010 documents have been provided. The screenshots below display the sample template and the document generated out of this template using this utility.
Word 2010 Template –> Generated Document:
Word 2010 Template –> Generated Document –> Refreshed Document:
Document refresh from within Word –> Refreshed Document:
CodeProject