Setting the first line as the file name in LibreOffice

Setting the first line as the file name in LibreOffice

LibreOffice Logo

One of the few features I missed moving from Microsoft Office was the auto name upon save, where Word takes the first line of the text and uses it to name the text file. LibreOffice (and OpenOffice before that) don’t have this feature! It’s a small thing but over time it becomes a growing nuisance!

Luckily there is an easy fix for that! Which enables you to enjoy the luxury of easy naming of files and limit the Untitled flood over time! 

We are going to use a feature known as macros. macros in office are a Visual Basic code that is used to preform a certain task over and over and is triggered by an event. In this post I’ll be showing how to create a macro that saves the file using the first line of text when pressing the key combination of CTRL + S (assigning the macro to save or save as will result in two files: untitled and the first line of text!) So at first, we are going to need our macro. I took this code as is from an OpenOffice form, it works fine without editing:

Sub FirstLineFileName_Writer

On Error goto EH