Free Support Forum - aspose.com

Checkboxes and MailMerge

Hello again,

the last post I saw RE this topic (at leat the last one I've found) is dated March 2007.
Has anything been added since then or is the workaround (http://www.aspose.com/community/forums/40351/showpost.aspx) still necessary (searching the help file returns no info) ?

If the workaround is still necessary, could the Author (Vladimir Averkin) shed some light on how to use these?

Thx in advance,
Marcus.


Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Checkboxes in the Word document are represented as FormFields. So you can easy work with checkboxes using FormFields collection. For example see the following code.

Document doc = new Document(@"Test058\in.doc");

FormField checkbox1 = doc.Range.FormFields["checkBox1"];

if (checkbox1.Type == FieldType.FieldFormCheckBox)

{

checkbox1.Checked = true; //false

}

doc.Save(@"Test058\out.doc");

I hope this could help you.

Best regards.