There is no function that will automate this, but you should be able to achieve it with a macro e.g.
Code:
Sub Macro1()
Dim oRng As Range
Dim sFind As String
Dim sAddr As String
Dim sPath As String
sFind = "(Xnnnn)" 'the text to find
sAddr = Mid(sFind, 2, Len(sFind) - 2) 'remove the brackets from the searched text
sPath = "folder\file " & sAddr & ".txt" 'assemble the link path
Set oRng = ActiveDocument.Range
With oRng.Find
Do While .Execute(sFind)
oRng.Hyperlinks.Add oRng, sPath, , , sFind
oRng.End = oRng.Hyperlinks(1).Range.End
oRng.Collapse 0
Loop
End With
lbl_Exit:
Set oRng = Nothing
Exit Sub
End Sub
The code assumes that sPath is a genuine path accessible from the document.
Note that I have not tested it with Word 2003, but I am pretty sure all the code examples worked in that version.