Plumtree EDK (Enterprise Web Development Kit) 5.4.0 |

# IDocumentManager.InsertNewFolder Method

Inserts a new document folder into the given document folder.

IDocumentFolder InsertNewFolder(
IDocumentFolder parentFolder,
IDocumentFolder newFolder,
bool inheritSecurity
);

#### Parameters

parentFolder
  The parent document folder to insert into. Cannot be `null`.
newFolder
  The new folder to be inserted. This object may be obtained by calling `CreateNewDocumentFolder`. Cannot be `null`.
inheritSecurity
  If set to true this will override the security set on the `IDocumentFolder` object, and will instead use the same security as the parent folder.

#### Return Value

A persisted IDocumentFolder. Note: the returned object will be a newly instantiated object and will not be equal to the `folder` parameter.

#### Remarks

This method will need to be called to persist any newly created document folder. The returned `IDocumentFolder` is the persisted document folder.

#### Exceptions

Exception Type | Condition
--- | ---
PermissionDeniedException | The user does not have permission to insert a document folder into the given parent folder.
NameAlreadyInUseException | There is already a document or document folder existed in the parent folder with the same name.
CollaborationException | The method call resulted in an error.
SoapException | There is a communication problem during the execution of the remote method call.
InvalidOperationException | The parent folder has not yet been inserted, has already been removed, or the new folder is not new.

#### See Also

IDocumentManager Interface | Plumtree.Remote.PRC.Collaboration.Document Namespace