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 in Visual Basic .NET
DescriptionThis example shows how to add files to the Recent Documents list and clear the list in Visual Basic .NET.
KeywordsOffice, Word, spell, spellcheck, VB.NET
CategoriesAPI, Windows, VB.NET
 
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.

 
Private Sub btnAdd_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles btnAdd.Click
    SHAddToRecentDocs(SHARD_PATH, txtFilename.Text)
    MessageBox.Show("OK")
End Sub

Private Sub btnClear_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles btnClear.Click
    SHAddToRecentDocs(SHARD_PATH, vbNullString)
    MessageBox.Show("OK")
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated