Can I change the content of the title bar from a macro?

The product I work on currently has an integration with Word. We use a Word macro to change the title bar to reflect the actual content being edited (along the lines of “Fred Smith’s educational history”), rather than the random name of the file. We are looking for a software package to replace Word and are wondering if this behavior can be replicated in LibreOffice. We are anticipating using only Writer, but I suspect that the answer is the same for all modules.

Hello,

This will replace all text on title line:

Sub ModifyTitleLine
  oCurrentController = ThisComponent.getCurrentController()
  oFrame = oCurrentController.getFrame()
  oFrame.Title = "Text to display."
End sub

Thank you!

You are welcome.

If this answers your question please tick the :heavy_check_mark: (upper left area of answer). It helps others to know there was an accepted answer.