I have the following line in my code:
doc.Range.UpdateFields();
On running that code, I received the error below:
System.InvalidCastException: Unable to cast object of type 'Aspose.Words.FieldStart' to type 'Aspose.Words.FieldSeparator'. at ա.ጎ.VisitFieldEnd(FieldEnd fieldEnd)
at Aspose.Words.FieldEnd.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.࠭(DocumentVisitor )
at Aspose.Words.Paragraph.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.࠭(DocumentVisitor )
at Aspose.Words.Body.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.࠭(DocumentVisitor )
at Aspose.Words.Section.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.࠭(DocumentVisitor )
at Aspose.Words.Document.Accept(DocumentVisitor visitor)
at ա.ጎ.ጒ(Node ࠂ) at ա.ጎ.ጓ(Node ࠂ)
at Aspose.Words.Range.UpdateFields()
What can be causing this? It seems to be happening only in documents that have been edited in MS Word 2007 with track changes turned on.
Any help is appreciated.
Thank you.