Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleAdd files to the Recent Documents list and clear the list
DescriptionThis example shows how to add files to the Recent Documents list and clear the list in Visual Basic 6 by using the SHAddToRecentDocs API function.
KeywordsRecent Documents, Recent Documents list
CategoriesAPI, Windows
 
To add a file to the Recent Documents list, call SHAddToRecentDocs passing it the flag SHARD_PATH and the document name. (The flag SHARD_PATH means you are passing in a file name.)

To clear the Recent Documents list, call SHAddToRecentDocs passing it a null string.

 
' Add the file to the Recent Documents list.
Private Sub cmdAdd_Click()
    SHAddToRecentDocs SHARD_PATH, txtDocumentName.Text
    MsgBox "OK"
End Sub

' Clear the Recent Documents list.
Private Sub cmdClear_Click()
    SHAddToRecentDocs SHARD_PATH, vbNullString
    MsgBox "OK"
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated