Calling UpdateFields Does not Update TOC in DOCX

Hi,


I have a problem whereby updating the TOC with Aspose.Words by calling UpdateFields does not actually update the TOC. It does break our TOC as I cannot even manually update the TOC afterwards.

I have tried doing this with the current latest version of Aspose.Words which is 13.6.0.0.

Using the following code:

public static byte[] UpdateTableOfContents(byte[] inDocument)
{
byte[] GeneratedFileBytes = null;
var docLicense = new License();
docLicense.SetLicense(“Aspose.lic”);
Document wordDocument;
using (MemoryStream wordDocumentStream = new MemoryStream(inDocument, 0, inDocument.Length))
{
wordDocument = new Document(wordDocumentStream);
}

using (MemoryStream docStream = new MemoryStream())
{
wordDocument.UpdateFields();
wordDocument.Save(docStream, SaveFormat.Docx);
var byteArray = docStream.ToArray();
GeneratedFileBytes = byteArray;
}

return GeneratedFileBytes;
}

We would appreciate your help with this.

Thank you

Hi Mia,


Thanks for your inquiry. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSNET-8545 in our issue tracking system. 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.

The issues you have found earlier (filed as WORDSNET-8545) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.