Macro for automatic updating file paths

From The Document Foundation Wiki
< Macros‎ | Writer
Jump to: navigation, search


There is often a problem that indexes, especially the table of contents aren't updated after changes happened. Documents can be sent with incorrect links.

This macro updates automatically file paths. If the macro gets linked to the command Save document (Extras ▸ Customize ▸ Events ▸ Save document), the file paths will be updated when the document is saved.


Sub RefreshDirectories
Dim i As Long
If ThisComponent.supportsService("") Then
    For i = 0 To ThisComponent.getDocumentIndexes().count - 1
    Next i
End If
End Sub ' RefreshDirectories