I need the code to retrieve files from folders in document library


Question: How to use part of a file name as a link within a word document
Answer: I think you are talking about a field and not a link as in hyperlink.  A hyperlink can have its display text different from its url.  A field cannot change its display text though.