I have a problem,
I have a .dotx file which has been supplied by customers. It contains a number of fields of different kinds added in developermode in Word.
I want to be able to use this dotx and fill it up with values.
How do I do this in C#-code?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The Microsoft OpemXML SDK allows you to manipulate docx/dotx files using c#. You can download the Microsoft OpenXML SDK from here.
You should first create a copy of your dotx file. Then find the fields/content palceholders in the template.
Here is a small example (using a simple word template with a rich text box content field):
The example above is a very simple example. You have to adapt it to your word template structure.
Hope, this helps.