Declare Sub SHAddToRecentDocs Lib "shell32.dll" (ByVal uFlags As Long, ByVal pv As Any)
SHAddToRecentDocs adds a shortcut to a file to the shell's Documents menu under the Start menu. To accomplish this, the function creates a shortcut to the file under the Recent directory (the folder identified by the CSIDL CSIDL_RECENT). Instead of adding a file to the Documents menu, this function can also clear the entire contents of the Documents menu.
SHAddToRecentDocs does not return a value.
When passing 0 for the pv parameter, you must use the expression CLng(0) to pass it correctly.
Const SHARD_PIDL = 1
Const SHARD_PATH = 2
' This code is licensed according to the terms and conditions listed here.
' First, clear the Documents menu. Then add a link to the file
' C:\MyDocs\report.txt to the Documents menu. Of course, you
' should always ask the user before you clear the Documents menu!
' Clear the Documents menu entirely.
SHAddToRecentDocs 0, CLng(0)
' Then add the file C:\MyDocs\report.txt to the menu.
SHAddToRecentDocs SHARD_PATH, "C:\MyDocs\report.txt"
Go back to the alphabetical Function listing.
Go back to the Reference section index.
Last Modified: December 28, 1999
This page is copyright © 1999 Paul Kuliniewicz.
Copyright Information Revised October 29, 2000
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/s/shaddtorecentdocs.html