We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

TOC using custom heading levels

Thanks for a great product and most of all the automatic TOC feature in version 9!

When I was about to use the new version in our solution I found that the TOC wasn’t generated at all in the ‘template’ document that we fill with text. After some researching I found out that it was a problem with the TOC field code that Word 2007 had generated when it was added to the document.

The problem appears if I use custom style reference for heading levels. Using the TOC dialog clicking options and removing the Heading1-3 levels and setting my custom styles as new levels for the TOC.
This generates a field code with something like this:
TOC \h \z \t "CustomHeading 1;1;CustomHeading2;2"

According to Microsoft’s own online help on TOC Field Code (found here) it states the following syntax:
\t "Style,Level, Style,Level,…"

Note the the difference in the separation character! Word generates semicolon (:wink: but according to the help it should be comma (,). I made the conclusion that Aspose.Words couldn’t handle the case where semicolon was used, which made my custom document to not render the TOC. When I manually changed it to comma in the ‘template’ document it worked like a charm.

This is actually a bug in Word 2007, but I suggest that you update your software so it can cope with this.
Attached is a word document containing some text with custom heading styles and a TOC generated by Word (containing the wrong separator character).

Andreas Backman

Hi Andreas,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for reporting this problem to us. I managed to reproduce it on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

Best regards.

The issues you have found earlier (filed as 16258) have been fixed in this update.

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