Hi
I'm using the latest released 1129 build. Create a new document.
Add text such as
"Heading 1
Heading 2"
Highlight all, set to Heading 1 style.
Generate ToC. This will not work. The code throws an exception during InsertTableOfContentsCommand.PrepareExecuteCore().
This seems to be because empty paragraphs are skipped and no bookmark added to "paragraphToBookmark" dictionary, but the later foreach loop that iterates the paragraphs and gets bookmark names from this dictionary doesn't skip any paragraphs - so the empty ones will throw an exception, as they aren't in the dictionary.
I'm using the latest released 1129 build. Create a new document.
Add text such as
"Heading 1
Heading 2"
Highlight all, set to Heading 1 style.
Generate ToC. This will not work. The code throws an exception during InsertTableOfContentsCommand.PrepareExecuteCore().
This seems to be because empty paragraphs are skipped and no bookmark added to "paragraphToBookmark" dictionary, but the later foreach loop that iterates the paragraphs and gets bookmark names from this dictionary doesn't skip any paragraphs - so the empty ones will throw an exception, as they aren't in the dictionary.