PutInFolder (NotesDocument - LotusScript®)

Adds a document to the specified folder. If the folder does not exist in the document's database, it is created.

Defined in



Call notesDocument .PutInFolder( folderName$ [, createonfail ] )



String. The name of the folder in which to place the document. The folder may be personal if the script is running on the workstation. If the folder is within another folder, specify a path to it, separating folder names with backward slashes, for example, "Vehicles\Bikes".


Boolean. Optional. Specify True so that a folder will be created if it does not exist.


If the document is already inside the folder you specify, PutInFolder 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:

Call doc.PutInFolder( "Vehicles\Bikes" )

If neither Vehicles nor Bikes exists, PutInFolder 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."

You cannot use this method on an unsaved document. Note that the method throws no error if you attempt to do so.