If you use RichViewActions, they store file names (when TrvActionOpen loads a file itself, or when you call its LoadFile method).
But if you do not use RichViewActions, you need to store a file name yourself. For example, see the demo in Demos\*\Editors\Editor 2\.