7.27.4 Add Method

Adds a new Folder to a Folders collection.
Syntax
object.Add (folderName)
Arguments
- object
- The name of a Folders collection. Required.
- folderName
- The name of the new Folder object being added. Required.
Remarks
The following example illustrates the use of the Add method to create a new folder:
function AddNewFolder(path, folderName)
{
var fs, f, fc, nf;
fs = new ActiveXObject("Scripting.FileSystemObject");
f = fs.GetFolder(path);
fc = f.SubFolders;
if (folderName != "" )
nf = fc.Add(folderName);
else
nf = fc.Add("New Folder");
}
An error occurs if the folderName already exists.
Copyright © 2000 Chili!Soft
|