SharedWorkspaceFolders.Add method (Office)

Adds a folder to the document library in a shared workspace. Returns a SharedWorkspaceFolder object.

Note

Beginning with Microsoft Office 2010, this object or member has been deprecated and should not be used.

Syntax

expression.Add (FolderName, ParentFolder)

expression Required. A variable that represents a SharedWorkspaceFolders object.

Parameters

Name Required/Optional Data type Description
FolderName Required String The name of the folder to be added to the current shared workspace.
ParentFolder Optional SharedWorkspaceFolder The subfolder in which to place the new folder, if not the main document library folder within the shared workspace. Add the folder to the main document library folder by leaving this optional argument empty.

Example

The following example adds a new folder to the folders collection of the shared workspace.

    Dim swsFolder As Office.SharedWorkspaceFolder 
    Set swsFolder = ActiveWorkbook.SharedWorkspace.Folders.Add("MyNewFolder") 
    MsgBox "New folder: " & swsFolder.FolderName, _ 
        vbInformation + vbOKOnly, _ 
        "New Folder in Shared Workspace" 
    Set swsFolder = Nothing 

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.