January 1, 2005

WinTask - SHAddToRecentDocs

'
' SHAddToRecentDocs - add a file name to the Windows Documents list, or clears it
'
' Author: Joe Strazzere
'

' SHAddToRecentDocs Lib "shell32.dll" (ByVal uFlags As Long, ByVal pv As String)

fil$=InputBox$("File to be added to Recent list : ","SAddToRecentDocs", "c:autoexec.bat")

ret=External("shell32","SHAddToRecentDocs",2,fil$)
msgbox(fil$+" added to Documents list",,"SHAddToRecentDocs")

pause 3 secs

ret=External("shell32","SHAddToRecentDocs",2,0)    ' clears the Documents list
msgbox("Documents list cleared",,"SHAddToRecentDocs")