teenup
teenup

Reputation: 7667

How to populate the content controls with real data from custom xml part using open xml sdk?

I have a Microsoft Word 2013 document (.docx) which contains several Content Controls that are data bound using XPATH Xpressions to a Custom Xml Part inside the document.

When I double click the document, Microsoft Word opens it and fetches all data from the Custom Xml Part to populate the Content Controls and the document is visible with the real data.

What I need is, I want to populate the Content Controls with data from embedded Custom Xml Part, using Open Xml Sdk programatically and save the final rendered document.

Is this possible using Open Xml Sdk?

What I need is similar to this question which is unanswered:

https://stackoverflow.com/questions/25186629/generating-word-doc-populating-from-custom-xml-to-the-word-document-having-conte

Upvotes: 0

Views: 794

Answers (1)

Laura Podrenik
Laura Podrenik

Reputation: 1

This can be done using Open XML SDK, but it is tedious, error prone and if using native data binding mechanisms, you will be limited to single values only. Support for loops/repeating blocks has been added in Word 2013. I suggest you to take a look at this .NET toolkit which is very powerful and it doesn’t require you to code much.

Upvotes: 0

Related Questions