I have a Google Document with paragraphs formatted as Heading 1 and Heading 2. I would like to create a table of content (TOC) in the document by script, not manually.
I have tried to find a tutorial or something like that, but I cannot. Maybe because this is not possible? Do I have to make the TOC by using the menu in Docs?
All I could find is: Class TableOfContents
Please let me know if a scripted TOC is possible.