views:

137

answers:

1

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?

+2  A: 

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)

Otaku
Thanks Otaku, I'm already aware of Eric's articles and I've already used the content controls toolkit. But only to deal with one record. As I said in my question I want to know how to push multiple records into a document to create a brochure of products. I can't use word automation - my app is web app.
Simon Lomax
@Simon Lomax: I've updated the text a bit. There is an example of how to do this in PowerPoint, see link above. It sounds like you're pretty familiar with Content Controls, so this should be an easy-enough port to WordprocessingML.
Otaku