FolderName Property

Microsoft Office Visual Basic

FolderName Property

Returns the name of a subfolder within the main document library folder of a shared workspace. Read-only String.

expression.FolderName()

expression    Required. An expression that returns a SharedWorkspaceFolder object.

Remarks

The FolderName property returns the subfolder name in the format parentfolder/subfolder. For example, if the shared workspace contains a folder named "Supporting Documents", the FolderName property returns Shared Documents/Supporting Documents.

Example

The following example displays the number of subfolders in the shared workspace and their names.

        Dim swsFolder As Office.SharedWorkspaceFolder
    Dim strFolderInfo As String
    strFolderInfo = "The shared workspace contains " & _
        ActiveWorkbook.SharedWorkspace.Folders.Count & " folder(s)." & vbCrLf
    If ActiveWorkbook.SharedWorkspace.Folders.Count > 0 Then
        For Each swsFolder In ActiveWorkbook.SharedWorkspace.Folders
            strFolderInfo = strFolderInfo & swsFolder.FolderName & vbCrLf
        Next
    End If
    MsgBox strFolderInfo, vbInformation + vbOKOnly, _
        "Folders in Shared Workspace"
    Set swsFolder = Nothing