VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Clear Recent Documents List

by rudz (10 Submissions)
Category: Windows System Services
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

Clears the recent documents list with a single command. Easy to implement in a text editor, or in some sort of trace-deleter program..

Assumes
place in a module, set 'Sub Main' as startup, press F5.
Code Returns
0 if no error occoured.
Side Effects
if there's _many_ entries in recent folder, have patience :)
API Declarations
Private Declare Function SHAddToRecentDocs Lib "Shell32" (ByVal lFlags As Long, ByVal lPv As Long) As Long

Rate Clear Recent Documents List

' Name : Clear all recent documents
' By  : Rudy Alex Kohn
'   [[email protected]]
Public Function ClearRecent()
 ' Clear the 'Recent Document' list
 ' Returns 0 if successfull
 ClearRecent = SHAddToRecentDocs(0, 0)
End Function
Sub Main()
 If MsgBox("This will clean the 'Recent Documents', proceed?", 68, "Clear Recent Documents List") = 7 Then End
 If ClearRecent <> 0 Then MsgBox "Error.."
End Sub

Download this snippet    Add to My Saved Code

Clear Recent Documents List Comments

No comments have been posted about Clear Recent Documents List. Why not be the first to post a comment about Clear Recent Documents List.

Post your comment

Subject:
Message:
0/1000 characters