Applying style to Form Fields in Aspose.Words

I wish to remove the strikethrough property in a text field in my .doc file. Hence, I’m using the following:

Document doc = new Document(templateFileName);
var formFields = doc.Range.FormFields;
formFields["identifier"].Font.StrikeThrough = false;

If it helps, I’m using Aspose.Words v13.2.0.0. I’m not sure why, but it doesn’t work, and there seems to be no method that dictates SetFont() or anything similar; Font is also a non-settable property in the form field object.

Hi Matthew,

Thanks for your inquiry. I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-11393. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Matthew,

Thanks for your patience. It is to inform you that our product team has completed the work on this issue (WORDSNET-11393) and has come to a conclusion that this issue and the undesired behavior you’re observing is actually not a bug in Aspose.Words. So, we have closed this issue as ‘Not a Bug’.

A form field is represented as several nodes inside: FieldStart, BookmarkStart, Run, FormField, FieldSeparator, Run, FieldEnd, BookmarkEnd. You should set font properties for all the parts of the field except the bookmarks to get correct result in ordinary and design modes. Please use following code example to achieve your requirements.

Document doc = new Document(MyDir + "FormFields.docx");
Field field = doc.Range.Fields[0];
Node node = field.Start;
while (node != null)
    if (node is Inline)
        Inline inline = (Inline)node;
        inline.Font.Size = 10;
        inline.Font.StrikeThrough = true;
    if (node == field.End)
    node = node.NextSibling;
doc.Save(MyDir + "Out.docx");