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