CreatedDate Property

Microsoft Office Visual Basic

CreatedDate Property

Returns the date and time when the shared workspace object was created. Read-only Variant.

expression.CreatedDate

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

Remarks

The SharedWorkspaceFolder and SharedWorkspaceMember objects do not have a CreatedDate property.

Example

The following example returns a list of shared workspace files whose date and time created is earlier than today.

        Dim swsFile As Office.SharedWorkspaceFile
    Dim dtmMidnight As Date
    Dim dtmFileDate As Date
    Dim strOlderFiles As String
    dtmMidnight = CDate(FormatDateTime(Now, vbShortDate) & " 12:00:00 am")
    For Each swsFile In ActiveWorkbook.SharedWorkspace.Files
        dtmFileDate = swsFile.CreatedDate
        If dtmFileDate < dtmMidnight Then
            strOlderFiles = strOlderFiles & swsFile.URL & vbCrLf
        End If
    Next
    MsgBox "Files older than today: " & vbCrLf & strOlderFiles, _
        vbInformation + vbOKOnly, "Older Files"
    Set swsFile = Nothing