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

Free Support Forum - aspose.com

Checkbox - set checked / unchecked

I would like to set checked / unchecked a checkbox by its name in a word document.


using the below code, the result comes up null.

FormFieldCollection FFC = doc.Range.FormFields;
OR
FormField chkBox = doc.Range.FormFields[name];
chkBox.Checked = bValue;
when I check the doc properties, it has everything except that the formfields is null.

Also, doc.Range.Text does show the full text of the document along with the textbox symbols in it.
1 Like

Hi there,

Thanks for your inquiry. Please note FormField class represents legacy form controls. However, StructuredDocumentTag class represents a structured document tag (SDT or content control) in a document. In your case, you need to use StructuredDocumentTag class. Please check following documentation link to check/uncheck checkbox, it will help you to accomplish the task.

Please feel free to contact us for any further assistance.

Best Regards,