Does this product support MS-Word-like forms entry, consisting of “protected” fields (where users cannot type) and data entry regions (text boxes, check boxes, etc.) where users can enter text?
Basically, what we want to achieve is to have word templates set up with all kinds of form fields, and then bind database fields to the form regions. Some of these regions are supposed to be repeating and growable. Will the DocIO maintain the word template format while populating data, such as page numbering, section headers/footers, etc.
There is no way to achieve it with one command and there is no universal way to do this. Generally, it can be done with some amount of coding, but you need to write specific code for each case.
I have attached the template document. The details about the employees are prsented in the template document. All the form field are merged in to the database. When I execute Mail merge all the record in the database can be merged in to the template.
To fill bookmarked form fields with data you should basically use the following code:
// fill FORMTEXT field with text
doc.Range.FormFields["Text1"].Result = "some text";
// check FORMCHECKBOX field
doc.Range.FormFields["Check1"].Result = "1";
You need to know that Aspose.Words MailMerge does not work on the form fields. So, if you want to fill form fields from the datasource you need to write your own Execute procedure. For example: