@ISIWARE This is not a regression. The behavior has been changed according to WORDSNET-24113 in 22.11 version of Aspose.Words. TOC items are now exported to HTML with the same formatting as they look in MS Word. Unfortunately, there is no option to disable this new behavior. I will consult with the development team regarding this.
For now, you can explicitly set the required formatting to TocN
styles to get the desired output:
Document doc = new Document(@"C:\Temp\in.docx");
StyleIdentifier[] tocStyles = new StyleIdentifier[]
{
StyleIdentifier.Toc1,
StyleIdentifier.Toc2,
StyleIdentifier.Toc3,
StyleIdentifier.Toc4,
StyleIdentifier.Toc5,
StyleIdentifier.Toc6,
StyleIdentifier.Toc7,
StyleIdentifier.Toc8,
StyleIdentifier.Toc9
};
foreach (StyleIdentifier identifier in tocStyles)
{
Style toc = doc.Styles[identifier];
toc.Font.Color = Color.Blue;
toc.Font.Underline = Underline.Single;
}
doc.Save(@"C:\Temp\out.html");