CreateDocument method

Creates a document in a database and returns a NotesDocument object that represents the new document. You must call Save if you want the new document to be saved to disk. When used with OLE automation, this method allows you to create a NotesDocument object without using New.

Defined in
NotesDatabase

Syntax
Set notesDocument = notesDatabase.CreateDocument

Return value
notesDocument
Usage
For more information, see the NotesDocument class.

Example
This script creates a new document in the current database, sets its Subject, and saves it. The document does not have a form associated with it; if a user opens the document in the user interface, Notes uses the default database form to display it.

Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set doc = db.CreateDocument
doc.Subject = "New building"
Call doc.Save( True, True )

Related topic
NotesDocument class