Posted on August 16, 2011
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| 'System & API - How to clear Documents List (under the Start button)
Option Explicit
Private Declare Sub SHAddToRecentDocs Lib "shell32.dll" (ByVal uFlags As Long, ByVal PV As String)
Sub Main()
Dim MyResult As Boolean
MyResult = ClearDocumentsMenu()
If MyResult = True Then
MsgBox "Documents removed."
Else
MsgBox "Documents not removed."
End If
End Sub
Public Function ClearDocumentsMenu() As Boolean
'Returns true if successful, false otherwise
SHAddToRecentDocs 2, vbNullString
ClearDocumentsMenu = Err.LastDllError = 0
End Function |