CreatedBy Property

Microsoft Office Visual Basic

CreatedBy Property

Returns the friendly name of the member who created the shared workspace object. Read-only String.

expression.CreatedBy

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

Remarks

The CreatedBy property returns the friendly name stored in the Name property of the DWSMember object.

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

Example

The following example lists files in the shared workspace that were created by users other than the creator of the workspace.

        Dim swsFile As Office.SharedWorkspaceFile
    Dim swsOwner As Office.SharedWorkspaceMember
    Dim strMemberFiles As String
    Set swsOwner = ActiveWorkbook.SharedWorkspace.Members(1)
    For Each swsFile In ActiveWorkbook.SharedWorkspace.Files
        If swsFile.CreatedBy <> swsOwner.Name Then
            strMemberFiles = strMemberFiles & swsFile.URL & vbCrLf
        End If
    Next
    MsgBox "These files were created by other users:" & _
        vbCrLf & strMemberFiles, _
        vbInformation + vbOKOnly, "Files Created by Other Users"
    Set swsOwner = Nothing
    Set swsFile = Nothing