Note to the unwary: you do need to remember to call Me.UpdateRecentFiles(...filename...) in your own code, wherever you load your files or save your files! Otherwise nothing will happen.
You also need to import System.Collections.Specialized and System.Linq, or you will get an error that Cast is unknown.