Writer: Auto-generate file links?

Is there an in-built way or more likely add-on to auto-generate links from text matching my pattern, to external files?

E.g. turn every (Xnnnn) into a link to folder\file Xnnnn.txt ?

It might be possible to achieve this with a macro.
However, that’s not something I know how to do.

Macro Guides


Workaround
You can create the first part of the link, which is always the same, as AutoText.
The different file names would then have to be added manually.

No big problem today, as the question is not really new. The thread has a macro and a hint to use Alt-Search-extension:

1 Like

Thank you.