How to automatically create child documents using the headings of the chosen level as document names?

Hello,

I am coming from this thread and would like to know whether there is also the possibility that writer uses the chapter headings of the chosen level as names for the child documents? So not to get just always the same name and an ascending number as document name?

Or does this need a macro to be developed and executed?

My goal is to automatically split a document into several documents - one per chapter which I need to convert to images later on so that I can embed them in discord. (Converting every chapter automatically into an image would save me a step - but I don’t think this will be possible.)

Can something like this be done? Otherwise I would have to manually rename hundreds of documents - which in the end nearly takes as long as copy-pasting every chapter into a single document and save it.

Thank you in advance!

Make a copy of your document!

Make sure, that the chapter headings are formatted with the style, which you have set at level 1 in Tools > Heading Numbering.

Go to File > Send > Create Master document. (You should save it to an empty folder.) That will change the current opened document to a master document so, that each chapter is in a section of its own. It does not simply makes sections but each chapter becomes a separate file (therefore the empty folder) and the master document has in the sections not the text itself but a link to the new created document. Even if you do not want to work with master documents you now have a bunch of new odt files, each with one chapter.