Hi,
I’m running into a InvalidOperationException because of a detected infinite loop when I call UpdateFieds on the first attached document. The same code works perfectly fine on the second attached document. Only difference between both files is that all the footnotes have been removed from the second one.
This is my code:
public void UpdateFields(string pathToDocument)
{
using (var stream = new MemoryStream(System.IO.File.ReadAllBytes(path))
{
var doc = new Document(stream);
doc.UpdateFields();
stream.Seek(0, SeekOrigin.Begin);
stream.SetLength(0);
doc.Save(“output.docx”, (SaveFormat)doc.OrginalLoadFormat);
}
}
I’m working with Aspose.Words for .NET Version 17.3.0.
Could you please tell me what’s my problem?
Thanks!