Reputation: 8972
I found this article - Binding Data to Word 2007 Content Controls Using Visual Studio Tools for the Office System (3.0) - and thought that that's exactly what I'm trying to do. I want to programatically build a product brochure using Content Controls and Open XML.
The article in question refers to an accompanying video which unfortunately does not appear to be available, nor does the code.
I posted a comment to ask where they are but in the meantime does anybody know of a good example. There are plenty of examples of binding/merging one record into an Open XML Word document. But I want to bind a whole list of records to create a product brochure.
Can anyone point me to good tutorial?
Upvotes: 2
Views: 2091
Reputation: 29153
This is probably one of the better articles I've seen on this from Eric White: Creating Data-Bound Content Controls using the Open XML SDK and LINQ to XML.
Also, to get familiar with how Content Controls work in WordprocessingML you may want to toy around with the open-source Word Content Control Toolkit.
For a repeater type of scenario to bring in mulitple data pieces, there is a product catalog example for how to do this in PowerPoint at Adding Repeating Data to PowerPoint. The concepts can be ported over to Word and Content Controls. (This original one was done with tables ported to Word at Pushing Data from a Database into a Word Document)
Upvotes: 1