Subj: list last files accessd Section: Programming Issues To: Kerry Kline, 75463,460 Thursday, February 11, 1999 11:07:49 PM From: Calvin G. Smith, 102226,2127 #726738 Hi Kerry! >>> I want to be able to display the last files accessed by my application in a list box and allow the user to select one (i.e. like Word, Excel, etc.). Hopefully I can do this without and INI file ... Does any one have any suggestions? <<< Yes, if you mean the last files opened, then the following code will help... Calvin Smith - Sr. Visual Basic/MS Access Consultant ******************************************************** WEB: http://www.CalvinSmithSoftware.com ******************************************************** Private Declare Function wu_apiGetWindowsDirectory Lib _ "kernel32" Alias "GetWindowsDirectoryA" (ByVal _ lpBuffer As String, ByVal nSize As Long) As Long Private Sub Form_Load() On Error GoTo Form_Load_Err Dim strBuffer As String Dim iSize As Integer Dim lResult As Long Dim strMyName As String iSize% = 256 strBuffer$ = Space$(iSize%) lResult& = wu_apiGetWindowsDirectory(strBuffer$, iSize%) strMyName$ = Dir$(Left$(strBuffer$, lResult&) & "\Recent\*.*") With List1 Do While strMyName$ <> "" If strMyName$ <> "." And strMyName$ <> ".." Then .AddItem strMyName$ End If strMyName$ = Dir Loop End With Form_Load_Exit: Exit Sub Form_Load_Err: If Err Then ' Do whatever you need to here! Resume Form_Load_Exit End If End Sub