Is there automatic table of contents in writer?

I would like the table of contents automatically updates when I change my headlines, is it possible to do?

You can refresh your table of contents with menu command Tools->Update->Update All.

You can use a macro that is triggered by the Save Document event that refreshes all tables and saves the document.

sub Refresh
rem UpdateAllIndexes hint from http://www.oooforum.org/forum/viewtopic.phtml?t=41113
dim document   as object
dim dispatcher as object
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:UpdateAllIndexes", "", 0, Array())
end sub

Assign this macro to the Save event Tools->Customize->Events.

Macro execution must be allowed for the document.

I love this answer :). It works flawlessly.
(After I figured out how to change a macro below the ‘organize macros’ dialoge and in ‘my macros’ this thingy.)

But I am not yet allowed to vote it up :slight_smile: