We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Document FormFields Count=0


We’re using Aspose.Words in order to fullfill a word document template with database data.

By the moment we are forced to use the Replace text funcionality with doc.Range.Replace because we are not able to use Form Fields collection, due to the FormFields collection always have Count=0 when we load the document template.

Following your documentation once the document is loaded the FormFields should contain the form fields elements, but we didn’t found the way to get this collection informed with simple document templates as the one you can find attached.

Could you please confirm if we have to create the fields in the template in a particular way or what we should do to be able of insert form fields in the document template and fullfill the data programmatically?.

Thanks in advance.

Best regards.

Hi there,

Thanks for your inquiry. Your documents does not contain the Form Fields. FormField class represents a single form field. Microsoft Word provides the following form fields: checkbox, text input and dropdown (combobox).

A complete form field in a Word document is a complex structure represented by several nodes: field start, field code such as FORMTEXT, form field data, field separator, field result, field end and a bookmark.

In your case, we suggest you please use mail merge feature of Aspose.Words. Please read following link for your kind reference.
Mail Merge using ‘Mustache’ Template Syntax

Hope this helps you. Please let us know if you have any more queries.