RecentFile Property

Microsoft FrontPage Visual Basic

RecentFile Property

Returns or sets a Long that represents the number of days that a new or recently modified file shows up in the Recently Added Files list in Reports view. For example, if the RecentFile property is set to 20, a new file or a file that has been modified will be classified as recent for the first 20 days of its existence. Read/write.

expression.RecentFile

expression    Required. An expression that returns one of the objects in the Applies To list.

Remarks

Use the OlderFile property to set the number of days a file exists in a Web site without being modified before it shows up in the Older Files list in Reports view.

Example

The following example prompts the user to enter the number of days a file can exist with the classification recent, and then sets the RecentFile property to that value. The subroutine SetRecent prompts the user for input, performs a validation on the input data, converts it to the correct type, and sets the RecentFile property to the new value. If the value is of an incorrect type, an error message is displayed to the user.

    Sub FPRecentFile()
'Sets a value that determines how long a file can be classified recent

   Dim objApp As FrontPage.Application
   Set objApp = FrontPage.Application
   Call SetRecent(objApp)

End Sub

Sub SetRecent(ByRef objApp As Application)
'Sets the value that determines how long a file will be classified as recent
    Dim varNum As Variant
    Dim lngNum As Long
    'Prompt the user to enter a value
    varNum = InputBox("Enter the number of days a file " & _
                      "can exist before it is classified as old.")
    'Check to see that the value is of the correct type
    If IsNumeric(varNum) Then
       'If it's numeric, convert it to Long
       lngNum = CLng(varNum)
       'Set the RecentFile value to the new value
       objApp.RecentFile = lngNum
       'Display the new setting information to the user
       MsgBox "The RecentFile value was set correctly." & vbCr & _
              "The number of days a new or modified file will be classified as recent is " _
               & lngNum & "."
    Else
       'Otherwise, display an error message to the user
       MsgBox "The input value was incorrect.", vbCritical
    End If

End Sub