For invalid formula, in word document generation getting !Syntax Error message

Hi Team,

We have a word template, in which we have added a word table and in one of table cell there is a invalid formula. But after document generation, we are getting the “!Syntax Error” text instead of that formula.
We are using 24.10 aspose.words version and that Syntax error message comes after calling Document.UpdateFields() method.
So is there any way to bypass the exception message (Syntax Error).
I am part of Conga organization and we already have paid license.

Below I have attached the word template for reference.

OutputDocument01.docx (13.6 KB)

@dwagh You can reset the field’s value if it has syntax error. For example, the following code resets field value to empty string:

Document doc = new Document(@"C:\Temp\in.docx");
doc.UpdateFields();
// Search for field with "!Syntax Error" value and replace its value with empty string.
foreach (Field f in doc.Range.Fields)
{
    if (f.Result == "!Syntax Error")
    {
        f.Result = "";
        // Also you can lock the field to avoid it's updating.
        f.IsLocked = true;
    }
}
doc.Save(@"C:\Temp\out.docx");