Hello,
I am using below code to Update TOC.
Aspose.Words.Document.UpdateFields();
Aspose.Words.Document.UpdatePageLayout();
But it throwing below exception.
System.NullReferenceException: Object reference not set to an instance of an object. at . ( , Boolean ) at . ( ) at .( ) at . ( ) at . ( , , , Boolean ) at .( ) at . ( ) at .( , , ) at .( , , ) at .( , , ) at .( ) at .() at .() at .(Field , , Boolean ) at . (Field , Boolean ) at .( ) at . ( ) at .( ) at .( , ) at .(Node , ) at Aspose.Words.Document.UpdateFields() .
And TOC not generated.
Can you suggest to avoid this exception and generate TOC.