Macros/Writer/006

Description
There is often a problem that indexes, such as the table of contents (which is a type of index), aren't updated after changes have occured. Documents can be sent with incorrect links.

This macro updates automatically the links in an index. It can be useful to link the macro to the command Save document, so that the links will be updated when the document is saved.

In the example of Table of Contents, imagine that you have created a document with various headers (which are assigned by right-click and, etc). And then now you insert a TOC by. Then if you add more headers, you can update the TOC by simply running this macro.

Code
In LibreOffice Basic: In Python: