Document.UpdateFields crashes for some files

We are using Aspose.Words for .NET. Calling Document.UpdateFields results in an System.InvalidOperationException for some doc and docx documents.

The bug does not occur if the files are first opened in word and the fields are updated there (Ctrl+A, F9).

Find attached a Visual Studio 2017 solution that shows this problem.
Steps to reproduce:

  • build attached solution
  • run the console program and see it crash

WordIssue.zip (242.3 KB)

@IBP,

We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-18380. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-18380) have been fixed in this Aspose.Words for .NET 19.5 update and this Aspose.Words for Java 19.5 update.