putInFolder (NotesDocument - JavaScript)

Adds a document to a folder.

Defined in

NotesDocument

Syntax

putInFolder(name:string) : void

putInFolder(name:string, createonfail:boolean) : void

Parameter Description
name The name of the folder in which to place the document. The folder may be personal if the program is running on a workstation. If the folder is within another folder, specify a path to it, separating folder names with a backslash. In a JavaScript literal, escape the backslash, for example, Vehicles\\Bikes.
createonfail If true (default), creates the folder if it does not exist.

Usage

If the folder does not exist, it is created.

If the document is already inside the folder you specify, this method does nothing. If you specify a path to a folder, and none of the folders exists, the method creates all of them for you. For example: doc.putInFolder( "Vehicles\\Bikes" ). If neither Vehicles nor Bikes exists, this method creates both, placing the Bikes folder inside the Vehicles folder.

This method cannot add the first document to a folder that is Shared, Personal on first use.

Examples

This button puts the current document into a folder specified by the user.
var doc:NotesDocument = currentDocument.getDocument();
if (doc != null) {
	doc.putInFolder(requestScope.folder); // folder is bound to an edit box
}