Header bar query and saving file name

Is there any way to add “Close” to the Tool bar?
It is in the drop down under File, but I would also like it on the tool bar.

In Word when you save a document it always suggest the top line of the document as the title. In LibreOffice I always have to re-type this. Is there any way to automate this?
Thanks
Arthur

You can write a macro what will fill-in the Document properties labels with the desired contents. And you can assign this macro to the Document save event.

Edit your question to improve it (don’t use an answer nor a comment). Describe exactly what you want to achieve.

There may be a problem of vocabulary. Is your “top bar” what we call the *tool bar"? I.e. a set of icons below the menu bar and above the document itself?

There also seems to be a second question not related to the previous about the default file name when saving for the first time. Such a feature is not offered by Writer and I don’t think it is desirable for two reasons at least:

  • this would impose a constraint on the first line (in “complex” documents the first line is not always the title but may contain technical ancillary data to “direct” further formatting; in letters, it is usually a date which is not really fit for a distinctive filename)
  • I suppose the save code is common to all LO components (Writer, Calc, Impress, …) and the notion of first line is different in every component, if relevant at all (e.g. in Draw)

AFAIK, Save does not read Properties to initialise filename (I just checked), so two macros are needed (if feasible): one to copy the first line into property Title and one to retrieve this property at save time to initialise the dialog.

See the Help of the built in Basic language (StarBasic), and please study Andrew Pitonyak’s free macro books:
https://www.pitonyak.org/oo.php

The cross at the top right? Else Ctrl+Q works for even speedier closing

Even with the above, if you really want the Close icon click Tools > Customise. In the dialogue that opens, select the Toolbars tab. In the left-hand pane Available commands select the the Close icon. In the right-hand pane, Assigned commands select an icon you want it to be beside (probably not Save), then click the right-facing arrow in the middle.

BTW Copying the top line before you start the first save means you can just paste the line in the dialogue anyway.

Many thanks for those who have posted. As a newbie you have been really helpful.
Best wishes to all. Art

Thanks for helpful replies. I have edited first question to Tool Bar.
Re the second one is there a link to an article on the writing of macros?
Thanks, Arthur

Thanks for the update. But this is no solution to the question. Either delete the “non-answer” or repost as a comment. Help us to keep the site tidy (I know, how to use it is not obvious).