To accomplish this, first enable the developer tab: (Steps from MS):
- Start the application.
- Click the Filetab.
- Click Options.
- In the categories pane, click Customize Ribbon.
- In the list of main tabs, select Developer.
- Click OK to close the Options dialog box.
Create your template by adding controls:
- Make sure you are at Developer tab (Marked as )
- You can drag and drop control from Ribbon (Marked as ) and set properties.
- Set a meaningful Title (Marked as ) which you can use in code.
- In case of drop down list add possible value (Marked as ).
- You can check the “Content control cannot be deleted” (Marked as ) to make sure user cannot delete the controls by mistake.
Make sure you are getting both SdtRun and SdtBlock objects to read entire content controls. To understand the Open XML Object Model you can go through several articles but you must use “Open XML SDK 2.0 Productivity Tool” to explore the file by yourself. It will speed-up the learning process. Here is a screenshot of the tools (exploring SampleSale.docx file)