Application.FileLoadLast method (Project)

Opens one of the recently used files.

Syntax

expression. FileLoadLast( _Number_ )

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data type Description
Number Optional Integer A number that specifies which of the most recently used files to open. The maximum value is 17 in a default installation of Project.

Return value

Boolean

Remarks

To specify the number of files to show on the Recent tab of the Backstage view, change the value in the Show this number of recent documents drop-down list in the Display section of the Advanced tab of the Project Options dialog box. The maximum number possible is 50.

Example

The following example opens the five most recently used files. It assumes the "Recently Used File List" option has been selected.

Sub OpenThe9MRUFiles() 
 
 Dim i As Integer ' Index used in For...Next loop 
 
 For i = 1 To 5 
 FileLoadLast i 
 ' Ignore errors that may be due to missing files. 
 On Error Resume Next 
 Next i 
 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.