Insert Document Into Recent Documents Menu

'Add a module to your project (In the menu choose Project -> Add Module, Then click Open)
'To see the results, Press on Start button and then choose Documents.
'You will see your document in this list.
'Insert the following code to your module:

Declare Sub SHAddToRecentDocs Lib "shell32.dll" (ByVal uFlags _
As Long, ByVal pv As String)

'Insert the following code to your form:

Private Sub Form_Load()
'Replace c:\windows\win.ini with the name of the file you want to enter
'into the Documents menu.
Call SHAddToRecentDocs(2, "c:\windows\win.ini")
End Sub

Go Back