Each version of Windows, as far back as I can remember (Word97 at least) seems to have a different way of storing Recent Files.
Sure enough my Most-Recenty-Used Word2003 application, written long before MSOffice increased its File list from 9 to, I think 50, needs a new set of file specifications, thus today:-
Code: Select all
Dim strRoot As String
'''' strRoot = strGetSpecialFolderPath("Recent")' 8997: "GetUsersRecent" contains a hard-coded path "C:\Users\Chris068\AppData\Roaming\Microsoft\Office\Recent"
'''' strRoot = "C:\Users\Chris068\AppData\Roaming\Microsoft\Office\Recent"' 8997: "GetUsersRecent" contains a hard-coded path "C:\Users\Chris068\AppData\Roaming\Microsoft\Office\Recent"
'''' strRoot = strFixPath(Environ("UserProfile")) ' 8997: "GetUsersRecent" contains a hard-coded path "C:\Users\Chris068\AppData\Roaming\Microsoft\Office\Recent"
'''' strRoot = strRoot & "AppData\Roaming\Microsoft\Office\Recent" ' 8997: "GetUsersRecent" contains a hard-coded path "C:\Users\Chris068\AppData\Roaming\Microsoft\Office\Recent"
strRoot = "C:\Users\cprgr\AppData\Roaming\Microsoft\Windows\Recent"
But the code which follows that definition now blows stack space:- I have a long time tried-and-tested function which should grab file names from the list of recent files:-
Code: Select all
Public Function Filer_GetFolderItems(strAr() As String, strRootPath As String)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' Filer_GetFolderItems loads a strng array with the Fullname of every file in a given folder tree.
' The program code is modified from my own Filer modules
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim FI As Shell32.FolderItem
Dim lng As Long
Dim DicFolder As New Scripting.Dictionary
With New Shell
With .NameSpace(strRootPath)
For Each FI In .Items
If Not (FI Is Nothing) Then
If FI.IsFolder Then ' Recurse down the folder tree
Call Filer_GetFolderItems(strAr, strRootPath)
Else
Debug.Print FI.Name
lng = lng + 1
DicFolder(lng) = FI.Name
End If
End If
Next
End With
End With
Call GetASetOfFiles(strRootPath, DicFolder, strAr) 'see what we've got
Set FI = Nothing
Set DicFolder = Nothing
'Sub TESTFiler_GetFolderItems()
' Dim strAr() As String
' ReDim strAr(0)
' Call Filer_GetFolderItems(strAr, "C:\Users\Chris\Recent\", True)
'End Sub
End Function
I see recent posts on "Jump Lists" which to me seem like implementation of Windows code that operates on the recent File list as does my MRUse application, except Jump Lists are geared towards filtering the recent files list to a specific application ("right click on the icon ...") whereas MRUse just builds a humongous list of every file in Word2003.
I am not asking for the VBA code to be debugged; that will be my jiob after I have cleared up the format of the *new* **improved** recent files list.
Thanks in Advance for any steering.
Cheers, Chris