P
Patricia Shannon
This macro displays the files in the recently used file lists, and allows the
user to optionally remove selected files from the list. The files are not
deleted from the system, they just are no longer in the recently used files
list.
Public Sub EditRecentFiles()
' Created by Patricia Shannon 04/04/2006
' Displays Recently Used files
' Allows selected files to be removed from the list
Dim RecentCntr
Dim NbrRecent
Dim Response
Dim HoldRecentFile As RecentFile
NbrRecent = Application.RecentFiles.Count
MsgBox "Nbr recent files=" & NbrRecent
Set HoldRecentFile = Application.RecentFiles(1)
'MsgBox TypeName(Application.RecentFiles(1))
For RecentCntr = NbrRecent To 1 Step -1
Set HoldRecentFile = Application.RecentFiles(RecentCntr)
Response = MsgBox("cntr=" & RecentCntr & " " _
& HoldRecentFile.Name _
& vbNewLine & "Delete?", vbYesNoCancel + vbDefaultButton2)
Select Case Response
Case vbCancel
GoTo endpgm
Case vbYes
HoldRecentFile.Delete
MsgBox "File deleted from recent files list"
End Select
Next RecentCntr
endpgm:
End Sub
user to optionally remove selected files from the list. The files are not
deleted from the system, they just are no longer in the recently used files
list.
Public Sub EditRecentFiles()
' Created by Patricia Shannon 04/04/2006
' Displays Recently Used files
' Allows selected files to be removed from the list
Dim RecentCntr
Dim NbrRecent
Dim Response
Dim HoldRecentFile As RecentFile
NbrRecent = Application.RecentFiles.Count
MsgBox "Nbr recent files=" & NbrRecent
Set HoldRecentFile = Application.RecentFiles(1)
'MsgBox TypeName(Application.RecentFiles(1))
For RecentCntr = NbrRecent To 1 Step -1
Set HoldRecentFile = Application.RecentFiles(RecentCntr)
Response = MsgBox("cntr=" & RecentCntr & " " _
& HoldRecentFile.Name _
& vbNewLine & "Delete?", vbYesNoCancel + vbDefaultButton2)
Select Case Response
Case vbCancel
GoTo endpgm
Case vbYes
HoldRecentFile.Delete
MsgBox "File deleted from recent files list"
End Select
Next RecentCntr
endpgm:
End Sub