Add Method (RecentFiles Collection)

Applies To

RecentFiles collection object.

Description

Adds a file to the list of recently used files.

Syntax

expression.Add(Document, ReadOnly)

expression Required. An expression that returns a RecentFiles object.

Document Required Variant. The document you want to add to the list of recently used files. You can specify this argument by using either the string name for the document or a Document object.

ReadOnly Optional Variant. True to make the document read-only.

See Also

DisplayRecentFiles property, RecentFiles property.

Example

This example adds the active document to the list of recently used files.

If ActiveDocument.Saved = True Then
    RecentFiles.Add Document:=ActiveDocument.Name
End If