V
Velavan
Hi,
I have a word template with approx 550 checkbox form fields and some textbox
form fields. I need to save this as XML data. Since word does not store the
checkbox values in the XML data while doing a save as XML data, I am trying
to iterate through the XML tags and create the XML data myself. This is slow
(takes about 2 mins). I am including the code below.
UnProtectDocument();
object o = 1;
foreach(XMLNode myXmlNode in m_Document.XMLNodes)
{
if(!myXmlNode.HasChildNodes)
{
Range range = myXmlNode.Range;
FormField formField = range.FormFields.get_Item(ref o);
if (formField.Type == WdFieldType.wdFieldFormCheckBox)
{
if (formField.CheckBox.Value == true)
{
Trace.WriteLine(formField.Name + " value = Checked");
}
}
}
}
ProtectDocument();
Thanks.
I have a word template with approx 550 checkbox form fields and some textbox
form fields. I need to save this as XML data. Since word does not store the
checkbox values in the XML data while doing a save as XML data, I am trying
to iterate through the XML tags and create the XML data myself. This is slow
(takes about 2 mins). I am including the code below.
UnProtectDocument();
object o = 1;
foreach(XMLNode myXmlNode in m_Document.XMLNodes)
{
if(!myXmlNode.HasChildNodes)
{
Range range = myXmlNode.Range;
FormField formField = range.FormFields.get_Item(ref o);
if (formField.Type == WdFieldType.wdFieldFormCheckBox)
{
if (formField.CheckBox.Value == true)
{
Trace.WriteLine(formField.Name + " value = Checked");
}
}
}
}
ProtectDocument();
Thanks.