Global.RecentFiles property (Word)

Returns a RecentFiles collection that represents the most recently accessed files.

Syntax

expression.RecentFiles

expression Required. A variable that represents a 'Global' object.

Remarks

For information about returning a single member of a collection, see Returning an object from a collection.

Example

This example opens the first item in the RecentFiles collection (the first document name listed on the File menu).

If RecentFiles.Count >= 1 Then RecentFiles(1).Open

This example displays the name of each file in the RecentFiles collection.

For Each rFile In RecentFiles 
 MsgBox rFile.Name 
Next rFile

See also

Global Object

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.