Syntax

expression.Add(FolderName, ParentFolder)

expression Required. A variable that represents a 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.

Visual Basic for Applications
 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: