View Single Post
 
Old 11-16-2021, 02:38 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,164
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I don't know if this forum has many .NET specialists, so pretty much all examples here are VBA which you would need to adapt to .NET. My last post above for example shows you how to insert a building block from the attached template in VBA.

I think perhaps you might be interested in mapped Content Controls which probably better aligns with getting field data from SQL and putting it into the right places in the Word document. Mapped CCs can be included in building blocks to allow you to customise document content at multiple levels.

A couple of threads worth exploring are:
https://www.msofficeforums.com/word/...challenge.html
https://www.msofficeforums.com/word/...-document.html

If you are using mapped CCs to your own embedded xml file, it is relatively simple to replace that xml file from sql database content.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote