Hi!
I try to use with Sections from your proposition. But our formfields are not protected after appleing ptotected sections ( even sections 0 ,2,4…) and unprotected sections.May i remove ( clear) the definition of formfield after merge the text into formfield ? ( but not a result text !).
I attach , my file after merge and protected just even sections. But this protect just the text .
This is
private void DocumentProtect()
{
Aspose.Words.Sections sectionProtected = AsposeDocument.Sections;
int intSections = 0;
try
{
WriteToEventLog("Protect With Aspose With" + sectionProtected.Count + "Sections", 2);
WriteToTextLog("Protect With Aspose With" + sectionProtected.Count + "Sections", 2);
AsposeDocument.Protect(ProtectionType.AllowOnlyFormFields, strProtection);
for (intSections = 1; intSections < sectionProtected.Count; intSections += 2)
{
AsposeDocument.Sections[intSections].ProtectedForForms = false;
WriteToTextLog("Protect With Aspose Section number " + intSections + " unprotected", 2);
}
}
catch (Exception err)
{
objUserDefinedObject.msg.rcMessage = err.Message;
objUserDefinedObject.msg.rcType = (int)msg.rcTypes.Error;
objUserDefinedObject.msg.rcNumber = 16;
WriteToTextLog("Error on insert data to field because protection: " + err.Message, 1);
WriteToEventLog("Error on insert data ti fields because protection: " + err.Message, 1);
}
}
Thank 's