Storage.RemoveChild method

The RemoveChild method removes a child object from this Storage object.

Syntax

Storage.RemoveChild(
  wpdObject,
  [ boolRecursive ]
)

Parameters

wpdObject

A WPDObject that is the child object to be deleted. If the child object does not exist, this method returns an error.

boolRecursive [optional]

A Boolean value that indicates whether the delete operation is recursive. If the object to be removed contains children, this parameter must be set or the method will fail. If the boolRecursive parameter is not specified, and the object does not contain children, the default value of "false" is assumed and a nonrecursive delete is performed.

Return value

This method does not return a value.

Remarks

To enable asynchronous behavior, set the handler for the onRemoveChildComplete event before calling this method.

Examples

The following JScript example demonstrates the different ways in which the RemoveChild method can be used.

// Removes someFolder nonrecursively.
storage.RemoveChild(someFolder, false);

// Also removes someFolder nonrecursively, but if someFolder has
// children, this method will fail. 
storage.RemoveChild(someFolder);
    
// Removes someFolder and all of the children in it.
storage.RemoveChild(someFolder, true);

Requirements

Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
Windows Server 2008 R2 [desktop apps only]

See also

Storage Object

WPDObject