<< Click to Display Table of Contents >> RecentFile (object) |
Access path: Application à RecentFiles à Item
1 Description
A RecentFile object represents one individual of the recently opened files. You can use it to retrieve the properties of such a file and to open it again.
An individual RecentFile object exists for each recently opened file. For each document that you open or close, the list of these files in the File menu will change accordingly – i.e., the respective RecentFile objects will be created or deleted dynamically.
2 Access to the object
The individual RecentFile objects can be accessed solely through enumerating the elements of the collection RecentFiles. You can access it through Applications.RecentFiles.
' Show the name of the first file in the File menu
MsgBox pm.Application.RecentFiles.Item(1).Name
3 Properties, objects, collections and methods
Properties:
▪FullName R/O
▪Name (default property) R/O
▪Path R/O
Objects:
▪Application → Application
▪Parent → RecentFiles
Methods:
▪Open
FullName (property, R/O)
Data type: String
Returns the path and name of the document in the File menu (e.g. "c:\Documents\Smith.pmdx").
Name (property, R/O)
Data type: String
Returns the name of the document (e.g. "Smith.pmdx").
Path (property, R/O)
Data type: String
Returns the path of the document (e.g. "c:\Documents").
Application (pointer to object)
Data type: Object
Returns the Application object.
Parent (pointer to object)
Data type: Object
Returns the parent object, i.e. RecentFiles.
Open (method)
Opens the appropriate document and returns the Workbook object for it.
Syntax:
Open
Parameters:
none |
Return type:
Example:
' Open the first recent file displayed in the File menu
pm.Application.RecentFiles(1).Open