RecentFile (object)

<< 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 tm.Application.RecentFiles.Item(1).Name

 3  Properties, objects, collections and methods

Properties:

FullName R/O

Name R/O (default property)

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:\Letters\Smith.tmdx").

Name (property, R/O)

Data type: String

Returns the name of the document (e.g. "Smith.tmdx").

Path (property, R/O)

Data type: String

Returns the path of the document (e.g. "c:\Letters").

Application (pointer to object)

Data type: Object

Returns the Application object.

Parent (pointer to object)

Data type: Object

Returns the parent object, i.e. Application.

Open (method)

Opens the related document and returns it as a Document object.

Syntax:

 Open

Parameters:

none

Return type:

Document

Example:

' Open the first document displayed in the File menu

tm.Application.RecentFiles(1).Open