I have a word document with multiple custom properties, when I try to unlink the fields in the documents related to these custom properties it removes the custom style I made for the footnote separator and reset it to the original.
Code to unlink fields
FieldsHelper.ConvertFieldsToStaticText(doc, FieldType.FieldDocProperty);
public class FieldsHelper
{
/// <summary>
/// Converts any fields of the specified type found in the descendants of the node into static text.
/// </summary>
/// <param name="compositeNode">The node in which all descendants of the specified FieldType will be converted to static text.</param>
/// <param name="targetFieldType">The FieldType of the field to convert to static text.</param>
public static void ConvertFieldsToStaticText(CompositeNode compositeNode, FieldType targetFieldType)
{
compositeNode.Range.Fields.Cast<Field>().Where(f => f.Type == targetFieldType).ToList().ForEach(f => f.Unlink());
}
}