How can I add a heading line like this?

Since I can’t attach file I’m just adding the required format.

Professional Summary

Ok, I found an easier way. On the header just insert TAB[your text]TAB, then select each tab and hit the “strikethrough” button on the formatting toolbar

EDIT: Scratch all that follows :wink:
Two possibilities, none of them perfect.

The first one is to insert both lines with the drawing tools and anchor them to the header. The text can be easily centred with a single Tab at the beginning of the paragraph.

The second one goes like this:

  • Open a Writer document and insert an “horizontal bar” character: U+2015
  • You can do that by typing 2015 and then pressing Alt X
  • Copy the character to the clipboard
  • Put the cursor on the header
  • Open the style editor (F11) and right click on the highlighted style → Edit
  • On the Tabs tab, select both tabstops and on the filling character select the custom option and paste the clipboard content. Accept.
  • Finally, back on the header insert a space, a tab, the text, another space, a second tab and the a last space

Depending on the typeface, the text length and who knows what else there is a possibility of the characters not “sticking together” and letting small gaps. You’ll need to do some trial and error to fix that.

Open a Writer document and insert an “horizontal bar” character: U+2015
You can do that by typing 2015 and then pressing Alt X
- I didn’t understand this, how can I do this. Alt X this is a windows option.

@Ro That was added to 5.1: Unicode character input with Alt + X

Such lines are “borders” of the paragraph. For a quick and simple solution use the respective icon from the “Border” drop-down in the toolbar or the sidebar. For advanced line settings like line width, style, color and padding use the tab “Border” in the paragraph properties dialog. Borders can be set in the paragraph style.

I think the OP want the line to be inline and not below/above the text, like I show on the screenshot I added to my edited post.

You are likely right. And your solution to format a tab works fine for that.