OlderFile 属性

       

返回或设置 Long 类型的值,该值确定文件在归为较旧文件之前必须在站点中存在的天数(没有经过修改)。一旦文件归为较旧文件,则将出现在 Microsoft FrontPage“报表”视图的“较旧的文件”视图中。可读写。

expression.OlderFile

expression  必选。返回 Application 对象的表达式。

示例

下列示例提示用户输入值,该值指定文件在归为较旧的文件之前必须存在的天数。该子例程 SetOldVal 提示用户输入数据,验证输入数据的有效性,将该数据转换为正确的类型,然后将 OlderFile 属性设置为新值。如果该值的类型不正确,则向用户显示一条错误消息。

Sub FPOldFile()
'Sets a value that determines how old a file is

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

End Sub

Sub SetOldVal(ByRef objApp As Application)
'Sets the value that determines how old a file is

    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 OlderFIle value to the new value
       objApp.OlderFile = lngNum
       'Display the new setting information to the user
       MsgBox "The OlderFile value was set correctly." & vbCr & _
              "The number of days after which a file becomes old is " _ & lngNum & "."
    Else
       'Otherwise, display an error message to the user
       MsgBox "The input value was incorrect.", vbCritical
    End If

End Sub