Prevent a file from showing up on the recently used files list
Article contributed by Bill Coan
Turn off the list when the document opens and turn it back on again when the document closes.
In order to do this, you need to create some document variables to store the user's original
settings. Then you need to capture those settings and store them in the document variables before
turning off the list. Finally, you need to use the document variables to turn the list back on with
the user's original settings. A separate subroutine is used for each of these actions. Generally
speaking, you will want to call these routines from the Document_Open and Document_Close
ActiveDocument.Variables.Add Name:="DisplayRecentFiles", Value:="0"
ActiveDocument.Variables.Add Name:="RecentFilesMaximum", Value:="0"
''make a record of user settings so they can be restored after my
''last document is closed
'Change user options to suit my requirements
Application.DisplayRecentFiles = True
Application.RecentFiles.Maximum = 4
'restore user settings to what they were before my first doc was opened