I have a word document that contains multiple fields. I Unlink fields from word using Aspose.Words 24.4, But it does not work.
Sample Code
void Main()
{
var doc = new Aspose.Words.Document(@"C:\Users\54390\Downloads\fieldUnlink\input.docx");
foreach (var field in doc.Range.Fields.ToList())
{
Console.WriteLine(field.DisplayResult);
Console.WriteLine(field.Type);
field.Unlink();
}
doc.Save(@"C:\Users\54390\Downloads\fieldUnlink\output.docx");
}
File
fieldUnlink.zip (37.1 KB)
@sullivan Could you please attach your input document here for testing? We will check the issue and provide you more information.
@sullivan Thank you for additional information. Unfortunately, there is no way to unlink EQ fields using Aspose.Words. The following fields are not unlinkable:
FieldType.FieldIndexEntry:
FieldType.FieldTOCEntry:
FieldType.FieldRefDoc:
FieldType.FieldEquation:
FieldType.FieldSymbol:
FieldType.FieldBarcode:
FieldType.FieldFormCheckBox:
FieldType.FieldTOAEntry:
FieldType.FieldPrivate:
FieldType.FieldAdvance:
FieldType.FieldBidiOutline: