enableFolder (NotesDatabase - JavaScript)

Ensures that a folder exists, creating it if necessary.

Defined in

NotesDatabase

Syntax

enableFolder(folder:string) : void
Parameter Description
folder The name of the folder.

Usage

If the folder exists, this method does nothing. If the folder does not exist, this method creates it.

Examples

This button adds documents to a folder based on the results of a full-text search. The button first creates or updates the full-text index, and ensures that the folder exists if the full-text search returns anything.
database.updateFTIndex(true);
var dc:NotesDocumentCollection = database.FTSearch("cayenne",20);
if (dc.getCount() > 0) {
	database.enableFolder("Spicy");
} else {
	return;
}
var doc:NotesDocument = dc.getFirstDocument();
while (doc != null) {
	doc.putInFolder("Spicy", false);
	var tmpdoc = dc.getNextDocument();
	doc.recycle();
	doc = tmpdoc;
}