RecentFiles




' Load the Most Recently Used file list.

Private Sub MRULoad()
Dim i As Integer
Dim file_title As String
Dim file_path As String

'Start with empty MRU list collections.

Set m_MRUTitles = New Collection
Set m_MRUPaths = New Collection

'Get the files from the registry.

For i = 1 To m_NUM_MRU
file_title = GetSetting(APP_NAME, _
"MRU_List", "Title" & Format$(i), "")
file_path = GetSetting(APP_NAME, _
"MRU_List", "Path" & Format$(i), "")

If Len(file_title) > 0 And Len(file_path) > 0 Then
m_MRUTitles.Add file_title
m_MRUPaths.Add file_path
End If
Next i

'Display the MRU entries.

MRUDisplay
End Sub

Private Sub MRUDisplay()
Dim i As Integer
'Display the menu items.

For i = 1 To m_MRUTitles.Count
mnuFileMRU(i).Caption = m_MRUTitles(i)
mnuFileMRU(i).Visible = True
Next i

'Hide any unnecessary menu items.

For i = m_MRUTitles.Count + 1 To m_NUM_MRU
mnuFileMRU(i).Visible = False
Next i

'Display the separator if we need it.

mnuFileMRUSep.Visible = (m_MRUTitles.Count > 0)
End Sub











( recentfiles.html )- by Paolo Puglisi - Modifica del 17/12/2023