I have created a document template file (.dotx) in Word 2007 and in this I have created a Quick Part. I have been attempting to access this quick part programmatically using C# and the Microsoft.Office.Interop.Word namespace. Once I have access to the Quick Part I want to populate its fields with the properties of a POCO, then replicate this for all the POCO’s in a List.
So far I have not been successful. Has anyone had any luck with this?
Note: I do not want to use the Open XML SDK if at all possible.
I found that I could access a Quick Part from a Document Template file using the following code:
The first parameter is the Word Application, the second is the path of the Document Template file, while the third is the name of the Quick Part in the template.