- #AUTOMATICALLY UPDATE TABLE OF CONTENTS WORD 2013 SOFTWARE#
- #AUTOMATICALLY UPDATE TABLE OF CONTENTS WORD 2013 CODE#
The code uses H2 headings ( # …) for sections, H3 headings ( # …) for sub-headings etc. Short, meaningful subpart markers that look "beautiful" in the browser's URL bar such as #heading-1-1 rather than markers containing transformed pieces of the actual heading. Visual emphasis on the first-level sections in the table of content by bold print.
Here, using an unordered list is possible, but not necessary: the indentation and bullet just add visual clutter and no function here, so we don't use a list for the first ToC level at all. These would create an indentation, would not link the number, and cannot be used to create decimal classification numbering like "1.1.". In the Table of Contents, these would appear as nested unordered lists on deeper levels. You can add as many levels of chapters and sub-chapters as you need. Inside your document, you would place the target subpart markers like this: ĭepending on where and how you use Markdown, the following should also work, and provides nicer-looking Markdown code: # 1.1. We came up with the following: Code # Content What I was missing is, however, a visually attractive formatting for a table of contents, using the limited options that Markdown provides.
#AUTOMATICALLY UPDATE TABLE OF CONTENTS WORD 2013 SOFTWARE#
Most are open source software and can be adapted to your needs. And my Edit of Nicolas Thery's answer to extend it to an overview was rejected.Īs mentioned in other answers, there are multiple ways to generate a table of contents automatically. However, I missed such an overview myself. I am aware, that I'm a little late with this answer. The Markdown editor Typora also generates a Table of Contents when you write in your document. If your Markdown file is to be displayed in a repo on, you can use the following at the location where you want your table of contents (more info here): MultiMarkdown as of 4.7 has a the following macro: Since Gitlab switched from Redcarpet to Kramdown as markdown engine, they now support the following syntax - TOC If = 1 Then _ĪctiveDocument.TablesOfContents(1).As an alternative to hand-made link lists, let's give an overview of all available out-of-the-box solutions to insert a table of contents (please comment and extend to keep this up-to-date): The easiest way to do this is to just check the Count property for the collection, as shown here:
Whenever you use commands like these in a macro, it is a good idea to make sure that there is actually a TOC in the document before you try to do any updating. If you want to update only the page numbers in the TOC, you use an entirely different method:ĪctiveDocument.TablesOfContents(1).UpdatePageNumbers The Update method is what does the work it updates the TOC. (In most documents the collection will consist of only a single item.) To update the entire TOC, you use this format of the command:ĪctiveDocument.TablesOfContents(1).Update Each item in the collection represents a single TOC in the document. You can update a TOC using a macro by utilizing the TablesOfContents collection.
This occurs because TOCs are implemented through the use of a field, and when you update all fields you are telling Word you also want to update the field underlying the TOC. If you have a document that contains a table of contents (TOC), and you update the fields in the entire document, Word asks if you want to update the entire table or just the page numbers in the table.