How to customize Insert / Field sub-menu?

Writer has way-extensive customization, which I would like to use. In this case, the Insert / Field menu (1st screenshot) omits the field I use most often: File Name

Help pages like Menus (Customizing) are unfortunately of no use. It seems impossible to edit that sub-menu. 2nd screenshot demonstrates that, for instance, it IS possible to edit the Zoom sub-menu, there is NO Insert / Field submenu to customize.

Am I missing something basic? I JUST want File Name to appear on the submenu and avoid going to the dialog box. Thank you.

Screenshot 2026-07-28 145414

I don’t know a solution for that either.


Workaround

Insert once in a document
the File name - field:
Example: Test 1.odt
Select the inserted “File name” field.
Select menu Tools > AutoText.
Enter “FN” for the “Shortcut”.
Select the “AutoText” and “New” buttons.
(AutoText done)

Now you can type “FN” anywhere in a document and press F3.
The filename updates automatically.
Alternatively, select Tools > Update > Update Fields (F9) from the menu.
Test 1.odt

Insert once in a document
the Path/File name - field:
Example: C:\E_Ask DE+EN\Test 1.odt
Select the inserted “Path/File name” field.
Select menu Tools > AutoText
Enter “PFN” for the “Shortcut”.
Select the “AutoText” and “New” buttons.
(AutoText done)

Now you can type “FN” or “PFN” anywhere in a document and press F3. The filename updates automatically. Alternatively, select Tools > Update > Update Fields (F9) from the menu.

136688 HB Insert once

Aufzeichnung 2026-07-28 220251


Test 1.odt (22,2 KB)


With me:
Version: 26.8.0.1 (X86_64)
Build ID: 2577b8a8e9a5d3f37124fb86a89387e3807953a7
CPU threads: 16; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster; VCL: win
Locale: en-US (de_DE); UI: en-US
Calc: CL threaded

2 Likes

Note that FN is already used to insert Formula Numbering, maybe use File instead.

1 Like

We can also write a macro to insert the desired field and assign it to any convenient key or add it to the Toolbar.
A. Pitonyak in his famous book OpenOffice.org Macros Explained.odt V4.1 provides an example of such a macro in the “Creating and adding text fields” section.

Update.

Sub InsertFileNameField()
  Dim oDoc as Object, oField as Object
  oDoc = ThisComponent
  oField = oDoc.createInstance("com.sun.star.text.TextField.FileName")
  oField.FileFormat = com.sun.star.text.FilenameDisplayFormat.NAME_AND_EXT
  On Error Resume Next
  oDoc.Text.insertTextContent(oDoc.CurrentController.ViewCursor, oField, False)
  On Error Goto 0
End Sub

Just for curiosity: What’s you reason?
I can hardly remember a case where I needed that field.

After decades of using Word I became accustomed to putting filename in footer. Some people actually print out documents on paper, and even file them away. For Neanderthals like me, the filename is a convenience. LO Writer offers that field but just erects a small speed bump to using it and IMHO the extensive customization of LO would be a bit improved.

That’s about what I had suppposed.
If you create the concerned files from one or a few templates, simply insert the wanted field(s) into the header/footer of the template(s).
To delete one of the fields from an open document is a matter of <=0.371 s :wink:.

Put it in the footer of your default template. Regarding the original question, I always hit Ctrl+F2 which gives me all the available fields. The most recently used tab is the active one.

1 Like